Versions in this module Expand all Collapse all v0 v0.195.1 Sep 17, 2023 v0.195.0 Sep 13, 2023 v0.194.3 Jun 11, 2023 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 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 + Lbrack []Comment + Rbrack []Comment + func (*ArrayExpression) Type() string + func (e *ArrayExpression) Copy() Node + func (e *ArrayExpression) MarshalJSON() ([]byte, error) + func (e *ArrayExpression) UnmarshalJSON(data []byte) error + type ArrayItem struct + Comma []Comment + 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 + type Assignment interface + type BadStatement struct + Text string + func (*BadStatement) Type() string + func (s *BadStatement) Copy() Node + func (s *BadStatement) MarshalJSON() ([]byte, error) + type BaseNode struct + Comments []Comment + Errors []Error + Loc *SourceLocation + func (b BaseNode) CommentList() []Comment + 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 + type Block struct + Body []Statement + Lbrace []Comment + Rbrace []Comment + func (*Block) Type() string + func (s *Block) Copy() Node + func (s *Block) MarshalJSON() ([]byte, error) + func (s *Block) UnmarshalJSON(data []byte) error + 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) + type BuiltinStatement struct + Colon []Comment + 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) + type CallExpression struct + Arguments []Expression + Callee Expression + Lparen []Comment + Rparen []Comment + func (*CallExpression) Type() string + func (e *CallExpression) Copy() Node + func (e *CallExpression) MarshalJSON() ([]byte, error) + func (e *CallExpression) UnmarshalJSON(data []byte) error + type Comment struct + Text string + type ConditionalExpression struct + Alternate Expression + Consequent Expression + Test Expression + Tk_else []Comment + Tk_if []Comment + Tk_then []Comment + func (*ConditionalExpression) Type() string + func (e *ConditionalExpression) Copy() Node + func (e *ConditionalExpression) MarshalJSON() ([]byte, error) + func (e *ConditionalExpression) UnmarshalJSON(data []byte) error + 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) + type DictExpression struct + Elements []*DictItem + Lbrack []Comment + Rbrack []Comment + 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 + Comma []Comment + 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) + type Duration struct + Magnitude int64 + Unit string + type DurationLiteral struct + Values []Duration + func (*DurationLiteral) Type() string + func (l *DurationLiteral) Copy() Node + func (l *DurationLiteral) MarshalJSON() ([]byte, error) + func (n *DurationLiteral) String() string + type DynamicType struct + func (DynamicType) Type() string + func (c *DynamicType) Copy() Node + func (c *DynamicType) UnmarshalJSON(data []byte) error + func (c DynamicType) MarshalJSON() ([]byte, error) + 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 + type File struct + Body []Statement + Eof []Comment + 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 + 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) + type FunctionExpression struct + Arrow []Comment + Body Node + Lparen []Comment + Params []*Property + Rparan []Comment + func (*FunctionExpression) Type() string + func (e *FunctionExpression) Copy() Node + func (e *FunctionExpression) MarshalJSON() ([]byte, error) + func (e *FunctionExpression) UnmarshalJSON(data []byte) error + 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 + 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 + type ImportDeclaration struct + As *Identifier + Path *StringLiteral + func (*ImportDeclaration) Type() string + func (d *ImportDeclaration) Copy() Node + func (d *ImportDeclaration) MarshalJSON() ([]byte, error) + type IndexExpression struct + Array Expression + Index Expression + Lbrack []Comment + Rbrack []Comment + func (*IndexExpression) Type() string + func (e *IndexExpression) Copy() Node + func (e *IndexExpression) MarshalJSON() ([]byte, error) + func (e *IndexExpression) UnmarshalJSON(data []byte) error + 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 + 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 + type LabelLiteral struct + Value string + func (*LabelLiteral) Type() string + func (l *LabelLiteral) Copy() Node + func (l *LabelLiteral) Key() string + func (l *LabelLiteral) MarshalJSON() ([]byte, error) + 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 + 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 + type MemberExpression struct + Lbrack []Comment + Object Expression + Property PropertyKey + Rbrack []Comment + func (*MemberExpression) Type() string + func (e *MemberExpression) Copy() Node + func (e *MemberExpression) MarshalJSON() ([]byte, error) + func (e *MemberExpression) UnmarshalJSON(data []byte) error + type MonoType interface + 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) + type Node interface + CommentList func() []Comment + Copy func() Node + Errs func() []Error + Location func() SourceLocation + Type func() string + func UnmarshalNode(data []byte) (Node, error) + type ObjectExpression struct + Lbrace []Comment + Properties []*Property + Rbrace []Comment + With *Identifier + func (*ObjectExpression) Type() string + func (e *ObjectExpression) Copy() Node + func (e *ObjectExpression) MarshalJSON() ([]byte, error) + 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 + type Package struct + Files []*File + Package string + Path string + func (*Package) Type() string + func (p *Package) Copy() Node + func (p *Package) MarshalJSON() ([]byte, error) + type PackageClause struct + Name *Identifier + func (*PackageClause) Type() string + func (c *PackageClause) Copy() Node + func (c *PackageClause) MarshalJSON() ([]byte, error) + 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 (param *ParameterType) UnmarshalJSON(data []byte) error + func (param ParameterType) MarshalJSON() ([]byte, error) + type ParenExpression struct + Expression Expression + Lparen []Comment + Rparen []Comment + func (*ParenExpression) Type() string + func (e *ParenExpression) Copy() Node + func (e *ParenExpression) MarshalJSON() ([]byte, error) + func (e *ParenExpression) UnmarshalJSON(data []byte) error + 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 + type PipeLiteral struct + func (*PipeLiteral) Type() string + func (p *PipeLiteral) Copy() Node + func (p *PipeLiteral) MarshalJSON() ([]byte, error) + type Position struct + Column int + Line int + func (p Position) IsValid() bool + func (p Position) Less(o Position) bool + func (p Position) String() string + type Property struct + Comma []Comment + Key PropertyKey + Separator []Comment + Value Expression + func (*Property) Type() string + func (p *Property) Copy() Node + func (p *Property) MarshalJSON() ([]byte, error) + func (p *Property) UnmarshalJSON(data []byte) error + 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 (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) + 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 + 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 + type SourceLocation struct + End Position + File string + Source string + Start Position + func (l *SourceLocation) Copy() *SourceLocation + func (l SourceLocation) IsValid() bool + func (l SourceLocation) Less(o SourceLocation) bool + func (l SourceLocation) String() string + type Statement interface + type StreamType struct + ElementType MonoType + func (StreamType) Type() string + func (arr StreamType) MarshalJSON() ([]byte, error) + func (c *StreamType) Copy() Node + func (nt *StreamType) UnmarshalJSON(data []byte) error + 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 + 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) + type TestCaseStatement struct + Block *Block + Extends *StringLiteral + ID *Identifier + func (*TestCaseStatement) Type() string + func (s *TestCaseStatement) Copy() Node + func (s *TestCaseStatement) MarshalJSON() ([]byte, error) + type TestStatement struct + Assignment *VariableAssignment + func (*TestStatement) Type() string + func (s *TestStatement) Copy() Node + func (s *TestStatement) MarshalJSON() ([]byte, error) + 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 + type TvarType struct + ID *Identifier + func (TvarType) Type() string + func (c *TvarType) Copy() Node + func (tv TvarType) MarshalJSON() ([]byte, error) + type TypeConstraint struct + Kinds []*Identifier + Tvar *Identifier + func (TypeConstraint) Type() string + func (c *TypeConstraint) Copy() Node + 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 (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 + 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 + 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 + type VectorType struct + ElementType MonoType + func (VectorType) Type() string + func (v *VectorType) Copy() Node + func (vt *VectorType) UnmarshalJSON(data []byte) error + func (vt VectorType) MarshalJSON() ([]byte, error) + type Visitor interface + Done func(node Node) + Visit func(node Node) Visitor + func CreateVisitor(f func(Node)) Visitor + type WithSource struct + Source *Identifier + With []Comment