parser

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnumSet

func EnumSet(p *Parser) (*ast.EnumSet, error)

func NewError

func NewError(tok *token.Token, format string, args ...any) error

func NewErrorWithEndToken

func NewErrorWithEndToken(start *token.Token, end *token.Token, format string, args ...any) error

func ParseArrayType

func ParseArrayType(p *Parser) (*ast.Array, error)

func ParseComment

func ParseComment(p *Parser) (*ast.Comment, error)

func ParseConst

func ParseConst(p *Parser) (*ast.Const, error)

func ParseCustomError

func ParseCustomError(p *Parser) (customError *ast.CustomError, err error)

func ParseDocument

func ParseDocument(p *Parser) (*ast.Document, error)

func ParseEnum

func ParseEnum(p *Parser) (enum *ast.Enum, err error)

func ParseExtend

func ParseExtend(p *Parser) (*ast.Extend, error)

func ParseMapKeyType

func ParseMapKeyType(p *Parser) (ast.Type, error)

func ParseMapType

func ParseMapType(p *Parser) (*ast.Map, error)

func ParseModel

func ParseModel(p *Parser) (*ast.Model, error)

func ParseModelField

func ParseModelField(p *Parser) (field *ast.Field, err error)

func ParseOption

func ParseOption(p *Parser) (option *ast.Option, err error)

func ParseOptions

func ParseOptions(p *Parser) (*ast.Options, error)

func ParseService

func ParseService(p *Parser) (service *ast.Service, err error)

func ParseServiceMethod

func ParseServiceMethod(p *Parser) (method *ast.Method, err error)

func ParseServiceMethodArgument

func ParseServiceMethodArgument(p *Parser) (arg *ast.Arg, err error)

func ParseServiceMethodReturnArg

func ParseServiceMethodReturnArg(p *Parser) (ret *ast.Return, err error)

func ParseType

func ParseType(p *Parser) (ast.Type, error)

func ParseValue

func ParseValue(p *Parser) (value ast.Value, err error)

func PrettyMessage

func PrettyMessage(filename string, src string, start int, end int, msg string) string

func PrettyMessageWithFilename

func PrettyMessageWithFilename(filename string, start int, end int, msg string) string

func Validate

func Validate(docs ...*ast.Document) error

Types

type Error

type Error struct {
	Filename string
	Start    int
	End      int
	Message  string
}

func (*Error) Error

func (e *Error) Error() string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(input string) *Parser

func NewWithFilenames

func NewWithFilenames(filenames ...string) *Parser

func (*Parser) Current

func (p *Parser) Current() *token.Token

func (*Parser) Next

func (p *Parser) Next() *token.Token

func (*Parser) Peek

func (p *Parser) Peek() *token.Token

Jump to

Keyboard shortcuts

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