Versions in this module Expand all Collapse all v0 v0.99.3 Jan 3, 2021 v0.99.2 Jan 3, 2021 Changes in this version + const DayUnit + const HourUnit + const MicrosecondUnit + const MillisecondUnit + const MinuteUnit + const MonthUnit + const NanosecondUnit + const SecondUnit + const WeekUnit + const YearUnit + var LogicalOperatorTokens = map[LogicalOperatorKind]string + var OperatorTokens = map[OperatorKind]string + func BooleanFromLiteral(lit *BooleanLiteral) bool + func Check(root Node) int + func DateTimeFromLiteral(lit *DateTimeLiteral) time.Time + func DurationFrom(l *DurationLiteral, _ time.Time) (time.Duration, error) + func FloatFromLiteral(lit *FloatLiteral) float64 + func Format(n Node) string + func GetError(n Node) error + func GetErrors(n Node) (errs []error) + func IntegerFromLiteral(lit *IntegerLiteral) int64 + func PrintErrors(w io.Writer, root Node) + func RegexpFromLiteral(lit *RegexpLiteral) *regexp.Regexp + func StringFromLiteral(lit *StringLiteral) string + func UnsignedIntegerFromLiteral(lit *UnsignedIntegerLiteral) uint64 + func Visit(node Node, f func(Node)) + func Walk(v Visitor, node Node) + type ArrayExpression struct + Elements []Expression + func (*ArrayExpression) Type() string + func (e *ArrayExpression) Copy() Node + func (e *ArrayExpression) MarshalJSON() ([]byte, error) + func (e *ArrayExpression) UnmarshalJSON(data []byte) error + func (e ArrayExpression) FromBuf(buf *fbast.ArrayExpression) *ArrayExpression + type ArrayType struct + ElementType MonoType + func (ArrayType) Type() string + func (arr ArrayType) MarshalJSON() ([]byte, error) + func (c *ArrayType) Copy() Node + func (nt *ArrayType) UnmarshalJSON(data []byte) error + func (t ArrayType) FromBuf(buf *fbast.ArrayType) *ArrayType + type Assignment interface + type BadStatement struct + Text string + func (*BadStatement) Type() string + func (s *BadStatement) Copy() Node + func (s *BadStatement) MarshalJSON() ([]byte, error) + func (s BadStatement) FromBuf(buf *fbast.BadStatement) *BadStatement + type BaseNode struct + Errors []Error + Loc *SourceLocation + func (b *BaseNode) FromBuf(buf *fbast.BaseNode) + func (b BaseNode) Copy() BaseNode + func (b BaseNode) Errs() []Error + func (b BaseNode) Location() SourceLocation + type BinaryExpression struct + Left Expression + Operator OperatorKind + Right Expression + func (*BinaryExpression) Type() string + func (e *BinaryExpression) Copy() Node + func (e *BinaryExpression) MarshalJSON() ([]byte, error) + func (e *BinaryExpression) UnmarshalJSON(data []byte) error + func (e BinaryExpression) FromBuf(buf *fbast.BinaryExpression) *BinaryExpression + type Block struct + Body []Statement + func (*Block) Type() string + func (s *Block) Copy() Node + func (s *Block) MarshalJSON() ([]byte, error) + func (s *Block) UnmarshalJSON(data []byte) error + func (s Block) FromBuf(buf *fbast.Block) *Block + type BooleanLiteral struct + Value bool + func BooleanLiteralFromValue(v bool) *BooleanLiteral + func (*BooleanLiteral) Type() string + func (l *BooleanLiteral) Copy() Node + func (l *BooleanLiteral) MarshalJSON() ([]byte, error) + func (l BooleanLiteral) FromBuf(buf *fbast.BooleanLiteral) *BooleanLiteral + type BuiltinStatement struct + ID *Identifier + Ty TypeExpression + func (*BuiltinStatement) Type() string + func (d *BuiltinStatement) UnmarshalJSON(data []byte) error + func (s *BuiltinStatement) Copy() Node + func (s *BuiltinStatement) MarshalJSON() ([]byte, error) + func (s BuiltinStatement) FromBuf(buf *fbast.BuiltinStatement) *BuiltinStatement + type CallExpression struct + Arguments []Expression + Callee Expression + func (*CallExpression) Type() string + func (e *CallExpression) Copy() Node + func (e *CallExpression) MarshalJSON() ([]byte, error) + func (e *CallExpression) UnmarshalJSON(data []byte) error + func (e CallExpression) FromBuf(buf *fbast.CallExpression) *CallExpression + type ConditionalExpression struct + Alternate Expression + Consequent Expression + Test Expression + func (*ConditionalExpression) Type() string + func (e *ConditionalExpression) Copy() Node + func (e *ConditionalExpression) MarshalJSON() ([]byte, error) + func (e *ConditionalExpression) UnmarshalJSON(data []byte) error + func (e ConditionalExpression) FromBuf(buf *fbast.ConditionalExpression) *ConditionalExpression + type DateTimeLiteral struct + Value time.Time + func DateTimeLiteralFromValue(v time.Time) *DateTimeLiteral + func (*DateTimeLiteral) Type() string + func (l *DateTimeLiteral) Copy() Node + func (l *DateTimeLiteral) MarshalJSON() ([]byte, error) + func (l DateTimeLiteral) FromBuf(buf *fbast.DateTimeLiteral) *DateTimeLiteral + type DictExpression struct + Elements []*DictItem + func (*DictExpression) Type() string + func (e *DictExpression) Copy() Node + func (e *DictExpression) MarshalJSON() ([]byte, error) + func (e *DictExpression) UnmarshalJSON(data []byte) error + type DictItem struct + Key Expression + Val Expression + func (*DictItem) Type() string + func (item *DictItem) MarshalJSON() ([]byte, error) + func (item *DictItem) UnmarshalJSON(data []byte) error + type DictType struct + KeyType MonoType + ValueType MonoType + func (DictType) Type() string + func (c *DictType) Copy() Node + func (c *DictType) UnmarshalJSON(data []byte) error + func (c DictType) MarshalJSON() ([]byte, error) + func (t DictType) FromBuf(buf *fbast.DictType) *DictType + type Duration struct + Magnitude int64 + Unit string + func (d Duration) FromBuf(buf *fbast.Duration) Duration + type DurationLiteral struct + Values []Duration + func (*DurationLiteral) Type() string + func (l *DurationLiteral) Copy() Node + func (l *DurationLiteral) MarshalJSON() ([]byte, error) + func (l DurationLiteral) FromBuf(buf *fbast.DurationLiteral) *DurationLiteral + type Error struct + Msg string + func (e Error) Error() string + type Expression interface + type ExpressionStatement struct + Expression Expression + func (*ExpressionStatement) Type() string + func (s *ExpressionStatement) Copy() Node + func (s *ExpressionStatement) MarshalJSON() ([]byte, error) + func (s *ExpressionStatement) UnmarshalJSON(data []byte) error + func (s ExpressionStatement) FromBuf(buf *fbast.ExpressionStatement) *ExpressionStatement + type File struct + Body []Statement + Imports []*ImportDeclaration + Metadata string + Name string + Package *PackageClause + func (*File) Type() string + func (f *File) Copy() Node + func (f *File) MarshalJSON() ([]byte, error) + func (f *File) UnmarshalJSON(data []byte) error + func (f File) FromBuf(buf *fbast.File) *File + type FloatLiteral struct + Value float64 + func FloatLiteralFromValue(v float64) *FloatLiteral + func (*FloatLiteral) Type() string + func (l *FloatLiteral) Copy() Node + func (l *FloatLiteral) MarshalJSON() ([]byte, error) + func (l FloatLiteral) FromBuf(buf *fbast.FloatLiteral) *FloatLiteral + type FunctionExpression struct + Body Node + Params []*Property + func (*FunctionExpression) Type() string + func (e *FunctionExpression) Copy() Node + func (e *FunctionExpression) MarshalJSON() ([]byte, error) + func (e *FunctionExpression) UnmarshalJSON(data []byte) error + func (e FunctionExpression) FromBuf(buf *fbast.FunctionExpression) *FunctionExpression + type FunctionType struct + Parameters []*ParameterType + Return MonoType + func (FunctionType) Type() string + func (c *FunctionType) Copy() Node + func (fun FunctionType) MarshalJSON() ([]byte, error) + func (param *FunctionType) UnmarshalJSON(data []byte) error + func (t FunctionType) FromBuf(buf *fbast.FunctionType) *FunctionType + type Identifier struct + Name string + func (*Identifier) Type() string + func (i *Identifier) Copy() Node + func (i *Identifier) Key() string + func (i *Identifier) MarshalJSON() ([]byte, error) + func (i *Identifier) UnmarshalJSON(data []byte) error + func (i Identifier) FromBuf(buf *fbast.Identifier) *Identifier + type ImportDeclaration struct + As *Identifier + Path *StringLiteral + func (*ImportDeclaration) Type() string + func (d *ImportDeclaration) Copy() Node + func (d *ImportDeclaration) MarshalJSON() ([]byte, error) + func (d ImportDeclaration) FromBuf(buf *fbast.ImportDeclaration) *ImportDeclaration + type IndexExpression struct + Array Expression + Index Expression + func (*IndexExpression) Type() string + func (e *IndexExpression) Copy() Node + func (e *IndexExpression) MarshalJSON() ([]byte, error) + func (e *IndexExpression) UnmarshalJSON(data []byte) error + func (e IndexExpression) FromBuf(buf *fbast.IndexExpression) *IndexExpression + type IntegerLiteral struct + Value int64 + func IntegerLiteralFromValue(v int64) *IntegerLiteral + func (*IntegerLiteral) Type() string + func (l *IntegerLiteral) Copy() Node + func (l *IntegerLiteral) MarshalJSON() ([]byte, error) + func (l *IntegerLiteral) UnmarshalJSON(data []byte) error + func (l IntegerLiteral) FromBuf(buf *fbast.IntegerLiteral) *IntegerLiteral + type InterpolatedPart struct + Expression Expression + func (*InterpolatedPart) Type() string + func (p *InterpolatedPart) Copy() Node + func (p *InterpolatedPart) MarshalJSON() ([]byte, error) + func (p *InterpolatedPart) UnmarshalJSON(data []byte) error + func (p InterpolatedPart) FromBuf(buf *fbast.StringExpressionPart) *InterpolatedPart + type Literal interface + type LogicalExpression struct + Left Expression + Operator LogicalOperatorKind + Right Expression + func (*LogicalExpression) Type() string + func (e *LogicalExpression) Copy() Node + func (e *LogicalExpression) MarshalJSON() ([]byte, error) + func (e *LogicalExpression) UnmarshalJSON(data []byte) error + func (e LogicalExpression) FromBuf(buf *fbast.LogicalExpression) *LogicalExpression + type LogicalOperatorKind int + const AndOperator + const OrOperator + func LogicalOperatorLookup(op string) LogicalOperatorKind + func (o *LogicalOperatorKind) UnmarshalText(data []byte) error + func (o LogicalOperatorKind) MarshalText() ([]byte, error) + func (o LogicalOperatorKind) String() string + type MemberAssignment struct + Init Expression + Member *MemberExpression + func (*MemberAssignment) Type() string + func (a *MemberAssignment) Copy() Node + func (a *MemberAssignment) MarshalJSON() ([]byte, error) + func (a *MemberAssignment) UnmarshalJSON(data []byte) error + func (a MemberAssignment) FromBuf(buf *fbast.MemberAssignment) *MemberAssignment + type MemberExpression struct + Object Expression + Property PropertyKey + func (*MemberExpression) Type() string + func (e *MemberExpression) Copy() Node + func (e *MemberExpression) MarshalJSON() ([]byte, error) + func (e *MemberExpression) UnmarshalJSON(data []byte) error + func (e MemberExpression) FromBuf(buf *fbast.MemberExpression) *MemberExpression + type MonoType interface + func DecodeMonoType(t *flatbuffers.Table, ty byte) MonoType + type NamedType struct + ID *Identifier + func (NamedType) Type() string + func (nt *NamedType) Copy() Node + func (nt *NamedType) UnmarshalJSON(data []byte) error + func (nt NamedType) MarshalJSON() ([]byte, error) + func (t NamedType) FromBuf(buf *fbast.NamedType) *NamedType + type Node interface + Copy func() Node + Errs func() []Error + Location func() SourceLocation + Type func() string + func UnmarshalNode(data []byte) (Node, error) + type ObjectExpression struct + Properties []*Property + With *Identifier + func (*ObjectExpression) Type() string + func (e *ObjectExpression) Copy() Node + func (e *ObjectExpression) MarshalJSON() ([]byte, error) + func (e ObjectExpression) FromBuf(buf *fbast.ObjectExpression) *ObjectExpression + type OperatorKind int + const AdditionOperator + const DivisionOperator + const EmptyOperator + const EqualOperator + const ExistsOperator + const GreaterThanEqualOperator + const GreaterThanOperator + const InOperator + const LessThanEqualOperator + const LessThanOperator + const ModuloOperator + const MultiplicationOperator + const NotEmptyOperator + const NotEqualOperator + const NotOperator + const NotRegexpMatchOperator + const PowerOperator + const RegexpMatchOperator + const StartsWithOperator + const SubtractionOperator + func OperatorLookup(op string) OperatorKind + func (o *OperatorKind) UnmarshalText(data []byte) error + func (o OperatorKind) MarshalText() ([]byte, error) + func (o OperatorKind) String() string + type OptionStatement struct + Assignment Assignment + func (*OptionStatement) Type() string + func (s *OptionStatement) Copy() Node + func (s *OptionStatement) MarshalJSON() ([]byte, error) + func (s *OptionStatement) UnmarshalJSON(data []byte) error + func (s OptionStatement) FromBuf(buf *fbast.OptionStatement) *OptionStatement + type Package struct + Files []*File + Package string + Path string + func DeserializeFromFlatBuffer(buf []byte) *Package + func (*Package) Type() string + func (p *Package) Copy() Node + func (p *Package) MarshalJSON() ([]byte, error) + func (p Package) FromBuf(buf []byte) *Package + type PackageClause struct + Name *Identifier + func (*PackageClause) Type() string + func (c *PackageClause) Copy() Node + func (c *PackageClause) MarshalJSON() ([]byte, error) + func (c PackageClause) FromBuf(buf *fbast.PackageClause) *PackageClause + type ParameterKind string + const Optional + const Pipe + const Required + type ParameterType struct + Kind ParameterKind + Name *Identifier + Ty MonoType + func (c *ParameterType) Copy() Node + func (p *ParameterType) Type() string + func (p ParameterType) FromBuf(buf *fbast.ParameterType) *ParameterType + func (param *ParameterType) UnmarshalJSON(data []byte) error + func (param ParameterType) MarshalJSON() ([]byte, error) + type ParenExpression struct + Expression Expression + func (*ParenExpression) Type() string + func (e *ParenExpression) Copy() Node + func (e *ParenExpression) MarshalJSON() ([]byte, error) + func (e *ParenExpression) UnmarshalJSON(data []byte) error + func (e ParenExpression) FromBuf(buf *fbast.ParenExpression) *ParenExpression + type PipeExpression struct + Argument Expression + Call *CallExpression + func (*PipeExpression) Type() string + func (e *PipeExpression) Copy() Node + func (e *PipeExpression) MarshalJSON() ([]byte, error) + func (e *PipeExpression) UnmarshalJSON(data []byte) error + func (e PipeExpression) FromBuf(buf *fbast.PipeExpression) *PipeExpression + type PipeLiteral struct + func (*PipeLiteral) Type() string + func (p *PipeLiteral) Copy() Node + func (p *PipeLiteral) MarshalJSON() ([]byte, error) + func (p PipeLiteral) FromBuf(buf *fbast.PipeLiteral) *PipeLiteral + type Position struct + Column int + Line int + func (p *Position) FromBuf(buf *fbast.Position) + func (p Position) IsValid() bool + func (p Position) Less(o Position) bool + func (p Position) String() string + type Property struct + Key PropertyKey + Value Expression + func (*Property) Type() string + func (p *Property) Copy() Node + func (p *Property) MarshalJSON() ([]byte, error) + func (p *Property) UnmarshalJSON(data []byte) error + func (p Property) FromBuf(buf *fbast.Property) *Property + type PropertyKey interface + Key func() string + type PropertyType struct + Name *Identifier + Ty MonoType + func (PropertyType) Type() string + func (c *PropertyType) Copy() Node + func (nt *PropertyType) UnmarshalJSON(data []byte) error + func (p PropertyType) FromBuf(buf *fbast.PropertyType) *PropertyType + func (prop PropertyType) MarshalJSON() ([]byte, error) + type RecordType struct + Properties []*PropertyType + Tvar *Identifier + func (RecordType) Type() string + func (c *RecordType) Copy() Node + func (rec RecordType) MarshalJSON() ([]byte, error) + func (t RecordType) FromBuf(buf *fbast.RecordType) *RecordType + type RegexpLiteral struct + Value *regexp.Regexp + func RegexpLiteralFromValue(v *regexp.Regexp) *RegexpLiteral + func (*RegexpLiteral) Type() string + func (l *RegexpLiteral) Copy() Node + func (l *RegexpLiteral) MarshalJSON() ([]byte, error) + func (l *RegexpLiteral) UnmarshalJSON(data []byte) error + func (l RegexpLiteral) FromBuf(buf *fbast.RegexpLiteral) *RegexpLiteral + type ReturnStatement struct + Argument Expression + func (*ReturnStatement) Type() string + func (s *ReturnStatement) Copy() Node + func (s *ReturnStatement) MarshalJSON() ([]byte, error) + func (s *ReturnStatement) UnmarshalJSON(data []byte) error + func (s ReturnStatement) FromBuf(buf *fbast.ReturnStatement) *ReturnStatement + type SourceLocation struct + End Position + File string + Source string + Start Position + func (l *SourceLocation) Copy() *SourceLocation + func (l SourceLocation) FromBuf(buf *fbast.SourceLocation) *SourceLocation + func (l SourceLocation) IsValid() bool + func (l SourceLocation) Less(o SourceLocation) bool + func (l SourceLocation) String() string + type Statement interface + type StringExpression struct + Parts []StringExpressionPart + func (*StringExpression) Type() string + func (e *StringExpression) Copy() Node + func (e *StringExpression) MarshalJSON() ([]byte, error) + func (e *StringExpression) UnmarshalJSON(data []byte) error + func (e StringExpression) FromBuf(buf *fbast.StringExpression) *StringExpression + type StringExpressionPart interface + type StringLiteral struct + Value string + func StringLiteralFromValue(v string) *StringLiteral + func (*StringLiteral) Type() string + func (l *StringLiteral) Copy() Node + func (l *StringLiteral) Key() string + func (l *StringLiteral) MarshalJSON() ([]byte, error) + func (l StringLiteral) FromBuf(buf *fbast.StringLiteral) *StringLiteral + type TestCaseStatement struct + Block *Block + ID *Identifier + func (*TestCaseStatement) Type() string + func (s *TestCaseStatement) Copy() Node + func (s *TestCaseStatement) MarshalJSON() ([]byte, error) + func (s TestCaseStatement) FromBuf(buf *fbast.TestCaseStatement) *TestCaseStatement + type TestStatement struct + Assignment *VariableAssignment + func (*TestStatement) Type() string + func (s *TestStatement) Copy() Node + func (s *TestStatement) MarshalJSON() ([]byte, error) + func (s TestStatement) FromBuf(buf *fbast.TestStatement) *TestStatement + type TextPart struct + Value string + func (*TextPart) Type() string + func (p *TextPart) Copy() Node + func (p *TextPart) MarshalJSON() ([]byte, error) + func (p *TextPart) UnmarshalJSON(data []byte) error + func (p TextPart) FromBuf(buf *fbast.StringExpressionPart) *TextPart + type TvarType struct + ID *Identifier + func (TvarType) Type() string + func (c *TvarType) Copy() Node + func (t TvarType) FromBuf(buf *fbast.TvarType) *TvarType + func (tv TvarType) MarshalJSON() ([]byte, error) + type TypeConstraint struct + Kinds []*Identifier + Tvar *Identifier + func (TypeConstraint) Type() string + func (c *TypeConstraint) Copy() Node + func (c TypeConstraint) FromBuf(buf *fbast.TypeConstraint) *TypeConstraint + func (typ_con TypeConstraint) MarshalJSON() ([]byte, error) + func (typ_expr *TypeConstraint) UnmarshalJSON(data []byte) error + type TypeExpression struct + Constraints []*TypeConstraint + Ty MonoType + func (TypeExpression) Type() string + func (c *TypeExpression) Copy() Node + func (t TypeExpression) FromBuf(buf *fbast.TypeExpression) *TypeExpression + func (typ_expr *TypeExpression) UnmarshalJSON(data []byte) error + func (typ_expr TypeExpression) MarshalJSON() ([]byte, error) + type UnaryExpression struct + Argument Expression + Operator OperatorKind + func (*UnaryExpression) Type() string + func (e *UnaryExpression) Copy() Node + func (e *UnaryExpression) MarshalJSON() ([]byte, error) + func (e *UnaryExpression) UnmarshalJSON(data []byte) error + func (e UnaryExpression) FromBuf(buf *fbast.UnaryExpression) *UnaryExpression + type UnsignedIntegerLiteral struct + Value uint64 + func UnsignedIntegerLiteralFromValue(v uint64) *UnsignedIntegerLiteral + func (*UnsignedIntegerLiteral) Type() string + func (l *UnsignedIntegerLiteral) Copy() Node + func (l *UnsignedIntegerLiteral) MarshalJSON() ([]byte, error) + func (l *UnsignedIntegerLiteral) UnmarshalJSON(data []byte) error + func (l UnsignedIntegerLiteral) FromBuf(buf *fbast.UnsignedIntegerLiteral) *UnsignedIntegerLiteral + type VariableAssignment struct + ID *Identifier + Init Expression + func (*VariableAssignment) Type() string + func (d *VariableAssignment) Copy() Node + func (d *VariableAssignment) MarshalJSON() ([]byte, error) + func (d *VariableAssignment) UnmarshalJSON(data []byte) error + func (d VariableAssignment) FromBuf(buf *fbast.VariableAssignment) *VariableAssignment + type Visitor interface + Done func(node Node) + Visit func(node Node) Visitor + func CreateVisitor(f func(Node)) Visitor