Versions in this module Expand all Collapse all v1 v1.42.9 Aug 3, 2023 v1.42.6 Nov 15, 2021 Changes in this version + const ASTKindCommentStatement + const ASTKindCompletedNestedSectionStatement + const ASTKindCompletedSectionStatement + const ASTKindEqualExpr + const ASTKindExpr + const ASTKindExprStatement + const ASTKindNestedSectionStatement + const ASTKindNone + const ASTKindSectionStatement + const ASTKindSkipStatement + const ASTKindStart + const ASTKindStatement + const BoolType + const DecimalType + const ErrCodeParseError + const ErrCodeUnableToReadFile + const IntegerType + const NoneType + const QuotedStringType + const StringType + const TokenComma + const TokenComment + const TokenLit + const TokenNL + const TokenNone + const TokenOp + const TokenSep + const TokenWS + var Start = newAST(ASTKindStart, AST{}) + func EqualExprKey(ast AST) string + func Walk(tree []AST, v Visitor) error + type AST struct + Children []AST + Kind ASTKind + Root Token + RootToken bool + func ParseAST(r io.Reader) ([]AST, error) + func ParseASTBytes(b []byte) ([]AST, error) + func (a *AST) AppendChild(child AST) + func (a *AST) GetChildren() []AST + func (a *AST) GetRoot() AST + func (a *AST) SetChildren(children []AST) + type ASTKind int + func (k ASTKind) String() string + type DefaultVisitor struct + Sections Sections + func NewDefaultVisitor() *DefaultVisitor + func (v *DefaultVisitor) VisitExpr(expr AST) error + func (v *DefaultVisitor) VisitStatement(stmt AST) error + type ParseError struct + func NewParseError(message string) *ParseError + func (err *ParseError) Code() string + func (err *ParseError) Error() string + func (err *ParseError) Message() string + func (err *ParseError) OrigError() error + type ParseStack struct + func (s *ParseStack) Len() int + func (s *ParseStack) MarkComplete(ast AST) + func (s *ParseStack) Pop() AST + func (s *ParseStack) Push(ast AST) + func (s ParseStack) List() []AST + func (s ParseStack) String() string + type ParseState uint + const CloseScopeState + const CommentState + const InvalidState + const MarkCompleteState + const OpenScopeState + const SectionState + const SkipState + const SkipTokenState + const StatementPrimeState + const StatementState + const TerminalState + const ValueState + type Section struct + Name string + func (t Section) Bool(k string) bool + func (t Section) Float64(k string) float64 + func (t Section) Has(k string) bool + func (t Section) Int(k string) int64 + func (t Section) String(k string) string + func (t Section) ValueType(k string) (ValueType, bool) + type Sections struct + func OpenFile(path string) (Sections, error) + func Parse(f io.Reader) (Sections, error) + func ParseBytes(b []byte) (Sections, error) + func (t Sections) GetSection(p string) (Section, bool) + func (t Sections) List() []string + type Token struct + ValueType ValueType + func (tok Token) Raw() []rune + func (tok Token) Type() TokenType + type TokenType int + func (t TokenType) String() string + type Value struct + Type ValueType + func (v *Value) Append(tok Token) + func (v Value) BoolValue() bool + func (v Value) FloatValue() float64 + func (v Value) IntValue() int64 + func (v Value) String() string + func (v Value) StringValue() string + type ValueType int + func (v ValueType) String() string + type Visitor interface + VisitExpr func(AST) error + VisitStatement func(AST) error