Versions in this module Expand all Collapse all v0 v0.0.6 Mar 22, 2018 Changes in this version + var EmptyObject = NewObjectType(nil) type Kind + const Regexp v0.0.5 Feb 9, 2018 Changes in this version + var EmptyArrayType = NewArrayType(Nil) + func ApplyNewDeclarations(n Node, declarations map[string]VariableDeclaration) + func Walk(v Visitor, node Node) + type ArrayExpression struct + Elements []Expression + func (*ArrayExpression) NodeType() string + func (e *ArrayExpression) Copy() Node + func (e *ArrayExpression) MarshalJSON() ([]byte, error) + func (e *ArrayExpression) Type() Type + func (e *ArrayExpression) UnmarshalJSON(data []byte) error + type BinaryExpression struct + Left Expression + Operator ast.OperatorKind + Right Expression + func (*BinaryExpression) NodeType() string + func (e *BinaryExpression) Copy() Node + func (e *BinaryExpression) MarshalJSON() ([]byte, error) + func (e *BinaryExpression) Type() Type + func (e *BinaryExpression) UnmarshalJSON(data []byte) error + type BlockStatement struct + Body []Statement + func (*BlockStatement) NodeType() string + func (s *BlockStatement) Copy() Node + func (s *BlockStatement) MarshalJSON() ([]byte, error) + func (s *BlockStatement) ReturnStatement() *ReturnStatement + func (s *BlockStatement) UnmarshalJSON(data []byte) error + type BooleanLiteral struct + Value bool + func (*BooleanLiteral) NodeType() string + func (*BooleanLiteral) Type() Type + func (l *BooleanLiteral) Copy() Node + func (l *BooleanLiteral) MarshalJSON() ([]byte, error) + type CallExpression struct + Arguments *ObjectExpression + Callee Expression + func (*CallExpression) NodeType() string + func (e *CallExpression) Copy() Node + func (e *CallExpression) MarshalJSON() ([]byte, error) + func (e *CallExpression) Type() Type + func (e *CallExpression) UnmarshalJSON(data []byte) error + type ConditionalExpression struct + Alternate Expression + Consequent Expression + Test Expression + func (*ConditionalExpression) NodeType() 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 (*DateTimeLiteral) NodeType() string + func (*DateTimeLiteral) Type() Type + func (l *DateTimeLiteral) Copy() Node + func (l *DateTimeLiteral) MarshalJSON() ([]byte, error) + type DeclarationScope map[string]VariableDeclaration + func (s DeclarationScope) Copy() DeclarationScope + type DurationLiteral struct + Value time.Duration + func (*DurationLiteral) NodeType() string + func (*DurationLiteral) Type() Type + func (l *DurationLiteral) Copy() Node + func (l *DurationLiteral) MarshalJSON() ([]byte, error) + func (l *DurationLiteral) UnmarshalJSON(data []byte) error + type Expression interface + Type func() Type + type ExpressionStatement struct + Expression Expression + func (*ExpressionStatement) NodeType() string + func (s *ExpressionStatement) Copy() Node + func (s *ExpressionStatement) MarshalJSON() ([]byte, error) + func (s *ExpressionStatement) UnmarshalJSON(data []byte) error + type ExternalVariableDeclaration struct + Identifier *Identifier + Type Type + func NewExternalVariableDeclaration(name string, typ Type) *ExternalVariableDeclaration + func (*ExternalVariableDeclaration) NodeType() string + func (d *ExternalVariableDeclaration) ID() *Identifier + func (d *ExternalVariableDeclaration) InitType() Type + func (d *ExternalVariableDeclaration) MarshalJSON() ([]byte, error) + func (s *ExternalVariableDeclaration) Copy() Node + type FloatLiteral struct + Value float64 + func (*FloatLiteral) NodeType() string + func (*FloatLiteral) Type() Type + func (l *FloatLiteral) Copy() Node + func (l *FloatLiteral) MarshalJSON() ([]byte, error) + type FunctionExpression struct + Body Node + Params []*FunctionParam + func (*FunctionExpression) NodeType() string + func (e *FunctionExpression) Copy() Node + func (e *FunctionExpression) MarshalJSON() ([]byte, error) + func (e *FunctionExpression) Type() Type + func (e *FunctionExpression) UnmarshalJSON(data []byte) error + type FunctionParam struct + Default Expression + Key *Identifier + Piped bool + func (*FunctionParam) NodeType() string + func (e *FunctionParam) MarshalJSON() ([]byte, error) + func (e *FunctionParam) UnmarshalJSON(data []byte) error + func (f *FunctionParam) Type() Type + func (p *FunctionParam) Copy() Node + type FunctionSignature struct + Params map[string]Type + PipeArgument string + ReturnType Type + type Identifier struct + Name string + func (*Identifier) NodeType() string + func (i *Identifier) Copy() Node + func (i *Identifier) MarshalJSON() ([]byte, error) + type IdentifierExpression struct + Name string + func (*IdentifierExpression) NodeType() string + func (e *IdentifierExpression) Copy() Node + func (e *IdentifierExpression) MarshalJSON() ([]byte, error) + func (e *IdentifierExpression) Type() Type + type IntegerLiteral struct + Value int64 + func (*IntegerLiteral) NodeType() string + func (*IntegerLiteral) Type() Type + func (l *IntegerLiteral) Copy() Node + func (l *IntegerLiteral) MarshalJSON() ([]byte, error) + func (l *IntegerLiteral) UnmarshalJSON(data []byte) error + type Kind int + const Array + const Bool + const Duration + const Float + const Function + const Int + const Invalid + const Nil + const Object + const Regex + const String + const Time + const UInt + func (k Kind) ElementType() Type + func (k Kind) Kind() Kind + func (k Kind) PipeArgument() string + func (k Kind) Properties() map[string]Type + func (k Kind) PropertyType(name string) Type + func (k Kind) ReturnType() Type + func (k Kind) String() string + type Literal interface + type LogicalExpression struct + Left Expression + Operator ast.LogicalOperatorKind + Right Expression + func (*LogicalExpression) NodeType() string + func (*LogicalExpression) Type() Type + func (e *LogicalExpression) Copy() Node + func (e *LogicalExpression) MarshalJSON() ([]byte, error) + func (e *LogicalExpression) UnmarshalJSON(data []byte) error + type MemberExpression struct + Object Expression + Property string + func (*MemberExpression) NodeType() string + func (e *MemberExpression) Copy() Node + func (e *MemberExpression) MarshalJSON() ([]byte, error) + func (e *MemberExpression) Type() Type + func (e *MemberExpression) UnmarshalJSON(data []byte) error + type NativeVariableDeclaration struct + Identifier *Identifier + Init Expression + func (*NativeVariableDeclaration) NodeType() string + func (d *NativeVariableDeclaration) ID() *Identifier + func (d *NativeVariableDeclaration) InitType() Type + func (d *NativeVariableDeclaration) MarshalJSON() ([]byte, error) + func (d *NativeVariableDeclaration) UnmarshalJSON(data []byte) error + func (s *NativeVariableDeclaration) Copy() Node + type Node interface + Copy func() Node + NodeType func() string + func UnmarshalNode(data []byte) (Node, error) + type ObjectExpression struct + Properties []*Property + func (*ObjectExpression) NodeType() string + func (e *ObjectExpression) Copy() Node + func (e *ObjectExpression) MarshalJSON() ([]byte, error) + func (e *ObjectExpression) Type() Type + type Program struct + Body []Statement + func New(prog *ast.Program, declarations map[string]VariableDeclaration) (*Program, error) + func (*Program) NodeType() string + func (p *Program) Copy() Node + func (p *Program) MarshalJSON() ([]byte, error) + func (p *Program) UnmarshalJSON(data []byte) error + type Property struct + Key *Identifier + Value Expression + func (*Property) NodeType() string + func (p *Property) Copy() Node + func (p *Property) MarshalJSON() ([]byte, error) + func (p *Property) UnmarshalJSON(data []byte) error + type RegexpLiteral struct + Value *regexp.Regexp + func (*RegexpLiteral) NodeType() string + func (*RegexpLiteral) Type() Type + 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) NodeType() string + func (s *ReturnStatement) Copy() Node + func (s *ReturnStatement) MarshalJSON() ([]byte, error) + func (s *ReturnStatement) UnmarshalJSON(data []byte) error + type Statement interface + type StringLiteral struct + Value string + func (*StringLiteral) NodeType() string + func (*StringLiteral) Type() Type + func (l *StringLiteral) Copy() Node + func (l *StringLiteral) MarshalJSON() ([]byte, error) + type Type interface + ElementType func() Type + Kind func() Kind + PipeArgument func() string + Properties func() map[string]Type + PropertyType func(name string) Type + ReturnType func() Type + func NewArrayType(elementType Type) Type + func NewFunctionType(sig FunctionSignature) Type + func NewObjectType(propertyTypes map[string]Type) Type + type UnaryExpression struct + Argument Expression + Operator ast.OperatorKind + func (*UnaryExpression) NodeType() string + func (e *UnaryExpression) Copy() Node + func (e *UnaryExpression) MarshalJSON() ([]byte, error) + func (e *UnaryExpression) Type() Type + func (e *UnaryExpression) UnmarshalJSON(data []byte) error + type UnsignedIntegerLiteral struct + Value uint64 + func (*UnsignedIntegerLiteral) NodeType() string + func (*UnsignedIntegerLiteral) Type() Type + func (l *UnsignedIntegerLiteral) Copy() Node + func (l *UnsignedIntegerLiteral) MarshalJSON() ([]byte, error) + func (l *UnsignedIntegerLiteral) UnmarshalJSON(data []byte) error + type VariableDeclaration interface + ID func() *Identifier + InitType func() Type + type Visitor interface + Done func() + Visit func(node Node) Visitor