Versions in this module Expand all Collapse all v0 v0.0.1 Sep 23, 2023 Changes in this version + const DefaultPrecision + const TBaseInt + const TBinary + const TBoolean + const TBracketClose + const TBracketOpen + const TComment + const TCurlClose + const TCurlOpen + const TDuration + const TEOF + const TFloat + const THex + const TInteger + const TMapOpen + const TOctal + const TRational + const TRawString + const TRegexp + const TSemicolon + const TString + const TWhitespace + const TWord + var ErrTooManyExprs = errors.New("too many expresssions") + var ErrUnexpectedEOF = errors.New("unexpected EOF") + func BigFloat(node Node) (v *big.Float) + func BigInt(node Node) (v *big.Int) + func BigRat(node Node) (v *big.Rat) + func Bool(node Node) (v, ok bool) + func Duration(node Node) (v time.Duration, ok bool) + func Float64(node Node) (v float64, ok bool) + func Int64(node Node) (v int64, ok bool) + func Quote(node Node) (str string, ok bool) + func Regexp(node Node) (v *regexp.Regexp) + func String(node Node) (str string, ok bool) + func Value(node Node) any + func Walk(parent ParentNode, walker Walker) (err error) + func Word(node Node) (str string, ok bool) + type Array struct + Elems []ExprNode + EndTok Token + StartTok Token + func (a *Array) String() string + func (a *Array) Token() Token + func (a *Array) Value() any + type Document struct + Children []Node + Name string + func (*Document) Token() Token + func (d *Document) Nodes() []Node + func (d *Document) String() string + type ExpectedError struct + Msg string + Tok Token + func (e *ExpectedError) Error() string + type ExprNode interface + Value func() any + type Lexer struct + Flags LexerFlag + Name string + Precision uint + func NewLexer(r io.Reader) *Lexer + func (l *Lexer) ReadToken() (tok Token, err error) + type LexerFlag uint64 + const LexDefaultFlags + const LexNoBaseInts + const LexNoBools + const LexNoDurations + const LexNoFloats + const LexNoNumbers + const LexNoRationals + const LexNoRegexps + const LexWordLiterals + type Literal struct + Tok Token + func (l *Literal) Token() Token + func (l *Literal) Value() any + type Location struct + Column int + Line int + Name string + Offset int + func (l Location) String() string + type Map struct + Elems map[string]*MapEntry + EndTok Token + StartTok Token + func (m *Map) Pairs() []*MapEntry + func (m *Map) String() string + func (m *Map) Token() Token + func (m *Map) Value() any + type MapEntry struct + Key ExprNode + Ord uint + Val ExprNode + func (m *MapEntry) Name() string + func (m *MapEntry) String() string + func (m *MapEntry) Token() Token + func (m *MapEntry) Value() any + type NamedReader interface + Name func() string + type Node interface + Token func() Token + type ParamNode interface + Name func() string + Parameters func() []ExprNode + type ParentNode interface + Nodes func() []Node + type Parser struct + func NewParser() *Parser + func (p *Parser) Document() *Document + func (p *Parser) Parse(tr TokenReader) (err error) + func (p *Parser) ParseExpr(tr TokenReader) (ExprNode, error) + type Section struct + Children []Node + EndTok Token + NameTok *Literal + Params []ExprNode + StartTok Token + func (s *Section) Name() string + func (s *Section) Nodes() []Node + func (s *Section) Parameters() []ExprNode + func (s *Section) String() string + func (s *Section) Token() Token + type Statement struct + EndTok Token + NameTok *Literal + Params []ExprNode + func (s *Statement) Name() string + func (s *Statement) Parameters() []ExprNode + func (s *Statement) String() string + func (s *Statement) Token() Token + type Token struct + End Location + Kind TokenKind + Raw []byte + Start Location + Value any + type TokenKind uint + func (t TokenKind) String() string + type TokenReader interface + ReadToken func() (Token, error) + type WalkError struct + Context ParentNode + Document *Document + Err error + Node Node + func (e *WalkError) Error() string + type WalkExiter interface + ExitSection func(Walker, *Section, ParentNode) error + type WalkMapper interface + Map func(node Node) (Node, error) + type Walker interface + EnterSection func(*Section) (Walker, error) + Statement func(*Statement) error