annotation

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

@index 커스텀 어노테이션 파서. 주석에서 @intent, @domainRule, @index 등 구조화된 태그를 추출한다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Normalizer

type Normalizer struct{}

Normalizer strips language-specific comment syntax from raw documentation blocks. @intent normalize comment text before annotation parsing across supported languages

func NewNormalizer

func NewNormalizer() *Normalizer

NewNormalizer creates a Normalizer. @intent provide a reusable comment normalizer for annotation extraction

func (*Normalizer) Normalize

func (n *Normalizer) Normalize(text string, language string) string

Normalize removes comment delimiters and line prefixes from raw comment text. @intent turn raw source comments into plain text consumable by the annotation parser @requires language matches the source file language for correct delimiter handling @ensures returned text has no leading comment markers and no trailing blank lines @see annotation.stripBlockDelimiters @see annotation.stripLinePrefix

type Parser

type Parser struct{}

Parser parses normalized comment text into structured annotation metadata. @intent convert stripped documentation text into model.Annotation values

func NewParser

func NewParser() *Parser

NewParser creates a Parser. @intent provide a reusable annotation parser instance for binding pipelines

func (*Parser) Parse

func (p *Parser) Parse(text string) (*model.Annotation, []string)

Parse extracts structured annotations from normalized comment text. Supports standard tags and custom AI/business context tags.

@param text normalizer output with comment prefixes stripped @return Annotation with Summary, Context, and DocTag list @intent extract machine-readable metadata from developer comments @domainRule first non-tag line becomes Summary, second becomes Context @domainRule recognized tags: param, return, see, intent, domainRule, sideEffect, mutates, requires, ensures @domainRule unknown tags are silently ignored Parse extracts structured annotations from normalized comment text. Returns the annotation and a slice of unrecognized tag names (e.g. ["domainrule"] for a typo). Callers that do not need warnings can discard the second return value. @ensures returned Annotation.RawText preserves the input text @return second value lists unknown tag names in encounter order @see annotation.Parser.parseTagLine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL