ag

package module
v0.0.0-...-5bdd4af Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 12 Imported by: 1

README

annotation generator

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCommentLocationCommentGroup

func FindCommentLocationCommentGroup(fileNode *ast.File, fileSet *token.FileSet, pos token.Pos) *ast.CommentGroup

func FindDocLocationCommentGroup

func FindDocLocationCommentGroup(fileNode *ast.File, fileSet *token.FileSet, pos token.Pos) *ast.CommentGroup

func ParseAnnotation

func ParseAnnotation(fileName string, text string) (*api.Annotations, error)

func ParseFile

func ParseFile(filename string, typeMaps map[api.AnnotationType]stream.Stream[string]) (result []*api.TypedAnnotation, packageName string, e error)

Types

type Annotation

type Annotation struct {
	BeforeUseless *string    `(~(Comment | "@"))*`
	Doc           []*Comment `@@*`
	Name          Name       `"@" @@`
	Params        *Params    `@@?`
	Extends       *Extends   `@@?`
	Comment       *Comment   `@@?`
	AfterUseless  *string    `(~(Comment | "@"))*`
}

type AnnotationExtend

type AnnotationExtend struct {
	Pos     lexer.Position
	Doc     []*Comment               `@@*`
	Name    Name                     `@@`
	Values  []structure.ValueWrapper `("(" @@* ")")?`
	Value   structure.ValueWrapper   `("=" @@)? ","?`
	Comment *Comment                 `@@?`
}

type AnnotationParam

type AnnotationParam struct {
	Pos     lexer.Position
	Doc     []*Comment             `@@*`
	Key     Key                    `@@`
	Value   structure.ValueWrapper `@@? ","?`
	Comment *Comment               `@@?`
}

type Annotations

type Annotations struct {
	Annotations []*Annotation `@@*`
}

type ClosedBracket

type ClosedBracket struct {
	Pos           lexer.Position
	ClosedBracket string `"}"`
}

type ClosedParenthesis

type ClosedParenthesis struct {
	Pos               lexer.Position
	ClosedParenthesis string `")"`
}

type Comment

type Comment struct {
	Pos  lexer.Position
	Text string `@Comment`
}

type Extends

type Extends struct {
	List          []*AnnotationExtend `"{" @@*`
	ClosedBracket ClosedBracket       `@@`
}

type Key

type Key struct {
	Pos  lexer.Position
	Text string `@Ident "="?`
}

type Name

type Name struct {
	Pos  lexer.Position
	Text string `@Ident`
}

type Params

type Params struct {
	List              []*AnnotationParam `"(" @@*`
	ClosedParenthesis ClosedParenthesis  `@@`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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