anococo

package module
v0.0.0-...-f5972dc Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 7 Imported by: 0

README

anococo

A tool for extracting coco command from annotations.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEachConstSpec

func ForEachConstSpec(genDecl *ast.GenDecl, fn func(spec *ast.ValueSpec, declComment *ast.CommentGroup))

ForEachConstSpec performs the operation fn on all sepc of a genDecl of type `token.CONST`. If the type of genDecl is not `token.CONST`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl

func ForEachImportSpec

func ForEachImportSpec(genDecl *ast.GenDecl, fn func(spec *ast.ImportSpec, declComment *ast.CommentGroup))

ForEachImportSpec performs the operation fn on all sepc of a genDecl of type `token.IMPORT`. If the type of genDecl is not `token.IMPORT`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl

func ForEachTypeSpec

func ForEachTypeSpec(genDecl *ast.GenDecl, fn func(spec *ast.TypeSpec, declComment *ast.CommentGroup))

ForEachTypeSpec performs the operation fn on all sepc of a genDecl of type `token.TYPE`. If the type of genDecl is not `token.TYPE`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl

func ForEachVarSpec

func ForEachVarSpec(genDecl *ast.GenDecl, fn func(spec *ast.ValueSpec, declComment *ast.CommentGroup))

ForEachVarSpec performs the operation fn on all sepc of a genDecl of type `token.VAR`. If the type of genDecl is not `token.VAR`, nothing will happen. For each fn execution, the Comment of genDecl will also be passed in. @see https://golang.org/pkg/go/ast/#GenDecl

func MockCocoList

func MockCocoList() []gococo.Coco

func ParseTypeDef

func ParseTypeDef(pth string) (map[string]*ParseResult, error)

Types

type GenDeclParseResult

type GenDeclParseResult struct {
	DeclComment string
	Doc         string
	Cocos       []gococo.Coco
}

func (GenDeclParseResult) String

func (result GenDeclParseResult) String() string

type InspectHandler

type InspectHandler func(pth string, p *ast.Package, node ast.Node) bool

InspectHandler

type ParseResult

type ParseResult struct {
	PackageName string
	Import      map[string]GenDeclParseResult
	Type        map[string]GenDeclParseResult
	Const       map[string]GenDeclParseResult
	Value       map[string]GenDeclParseResult
}

func NewResult

func NewResult() *ParseResult

func (*ParseResult) String

func (result *ParseResult) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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