Documentation ¶
Index ¶
- type AppendNode
- type ArrayNode
- type Block
- type BlockNode
- type BodyBlock
- type Builder
- func (b *Builder) AddExtension(e *Extension)
- func (b *Builder) Build(p *parser.Parser, fs FS) error
- func (b *Builder) Error(level ErrorLevel, pos *tokens.Pos, format string, args ...interface{})
- func (b *Builder) FixTypes(args *[]Node, typs []types.Type, pos *tokens.Pos)
- func (b *Builder) IR() *IR
- func (b *Builder) MatchTypes(pos *tokens.Pos, args []Node, typs []types.Type) bool
- type BuiltinFn
- type Call
- type CallNode
- type CanCastNode
- type Case
- type CastNode
- type CompareNode
- type CompareOperation
- type ConcatNode
- type Const
- type Default
- type DefineNode
- type Error
- type ErrorLevel
- type ExistsNode
- type Extension
- type ExtensionCall
- type FS
- type FnCallNode
- type FnNode
- type Function
- type GetNode
- type GetStructNode
- type IR
- type IfNode
- type IndexNode
- type KeysNode
- type LengthNode
- type LogicalOp
- type LogicalOpNode
- type MakeNode
- type MathNode
- type MathOperation
- type Node
- type NullCall
- type PanicNode
- type Param
- type PrintNode
- type ReturnNode
- type Scope
- func (s *Scope) AddVariable(name string, typ types.Type, pos *tokens.Pos) int
- func (s *Scope) CurrScopeGetVar(name string) (int, bool)
- func (s *Scope) CurrScopeInfo() *ScopeInfo
- func (s *Scope) CurrType() ScopeType
- func (s *Scope) GetVar(name string) (int, bool)
- func (s *Scope) HasType(typ ScopeType) bool
- func (s *Scope) Pop()
- func (s *Scope) Push(typ ScopeType)
- func (s *Scope) Variable(id int) *Variable
- type ScopeFrame
- type ScopeInfo
- type ScopeType
- type SetIndexNode
- type SetNode
- type SetStructNode
- type SliceNode
- type SwitchNode
- type TimeMode
- type TimeNode
- type TypedNode
- type TypedValue
- type VarNode
- type Variable
- type WhileNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendNode ¶
func (*AppendNode) Args ¶
func (a *AppendNode) Args() []Node
type Builder ¶
type Builder struct { Scope *Scope Funcs map[string]*Function Body []Node Errors []*Error // contains filtered or unexported fields }
func NewBuilder ¶
func NewBuilder() *Builder
func (*Builder) AddExtension ¶
func (*Builder) Error ¶
func (b *Builder) Error(level ErrorLevel, pos *tokens.Pos, format string, args ...interface{})
type BuiltinFn ¶
func BuiltinFns ¶
func BuiltinFns() []*BuiltinFn
type Call ¶
func NewTypedValue ¶
type CanCastNode ¶
func (*CanCastNode) Args ¶
func (c *CanCastNode) Args() []Node
func (*CanCastNode) Type ¶
func (c *CanCastNode) Type() types.Type
type CompareNode ¶
type CompareNode struct { Op CompareOperation Lhs Node Rhs Node // contains filtered or unexported fields }
func (*CompareNode) Args ¶
func (c *CompareNode) Args() []Node
func (*CompareNode) Type ¶
func (c *CompareNode) Type() types.Type
type CompareOperation ¶
type CompareOperation int
const ( CompareOperationEqual CompareOperation = iota CompareOperationNotEqual CompareOperationLess CompareOperationGreater CompareOperationLessEqual CompareOperationGreaterEqual )
func (CompareOperation) String ¶
func (c CompareOperation) String() string
type ConcatNode ¶
type ConcatNode struct {
Values []Node
}
func (*ConcatNode) Args ¶
func (c *ConcatNode) Args() []Node
func (*ConcatNode) Type ¶
func (c *ConcatNode) Type() types.Type
type DefineNode ¶
type DefineNode struct { NullCall Var int Value Node InScope bool // Check if accessing var outside of function (helps with recursion) // contains filtered or unexported fields }
func (*DefineNode) Args ¶
func (d *DefineNode) Args() []Node
type ErrorLevel ¶
type ErrorLevel int
const ( ErrorLevelError ErrorLevel = iota ErrorLevelWarning // TODO: Use this )
type ExistsNode ¶
func (*ExistsNode) Args ¶
func (g *ExistsNode) Args() []Node
func (*ExistsNode) Type ¶
func (g *ExistsNode) Type() types.Type
type ExtensionCall ¶
func (*ExtensionCall) Pos ¶
func (e *ExtensionCall) Pos() *tokens.Pos
func (*ExtensionCall) Type ¶
func (e *ExtensionCall) Type() types.Type
type FnCallNode ¶
func NewFnCallNode ¶
func (*FnCallNode) Args ¶
func (c *FnCallNode) Args() []Node
func (*FnCallNode) Pos ¶
func (c *FnCallNode) Pos() *tokens.Pos
func (*FnCallNode) Type ¶
func (c *FnCallNode) Type() types.Type
type Function ¶
type GetNode ¶
func NewGetNode ¶
type GetStructNode ¶
func (*GetStructNode) Args ¶
func (g *GetStructNode) Args() []Node
func (*GetStructNode) Type ¶
func (g *GetStructNode) Type() types.Type
type IndexNode ¶
func NewIndexNode ¶
type LengthNode ¶
type LengthNode struct {
Value Node
}
func (*LengthNode) Args ¶
func (l *LengthNode) Args() []Node
func (*LengthNode) Type ¶
func (l *LengthNode) Type() types.Type
type LogicalOpNode ¶
func (*LogicalOpNode) Args ¶
func (l *LogicalOpNode) Args() []Node
func (*LogicalOpNode) Type ¶
func (l *LogicalOpNode) Type() types.Type
type MathNode ¶
type MathNode struct { Op MathOperation Lhs Node Rhs Node // contains filtered or unexported fields }
func NewMathNode ¶
func NewMathNode(op MathOperation, lhs, rhs Node, typ types.Type) *MathNode
type MathOperation ¶
type MathOperation int
const ( MathOperationAdd MathOperation = iota MathOperationSub MathOperationMul MathOperationDiv MathOperationPow MathOperationMod )
func (MathOperation) String ¶
func (m MathOperation) String() string
type ReturnNode ¶
func (*ReturnNode) Args ¶
func (r *ReturnNode) Args() []Node
type Scope ¶
type Scope struct { Variables []*Variable // contains filtered or unexported fields }
func (*Scope) AddVariable ¶
func (*Scope) CurrScopeInfo ¶
type ScopeFrame ¶
type ScopeInfo ¶
type ScopeInfo struct {
Frames []ScopeFrame // Top frame is last
}
type SetIndexNode ¶
func (*SetIndexNode) Args ¶
func (s *SetIndexNode) Args() []Node
type SetStructNode ¶
type SetStructNode struct { NullCall Struct Node Field int Value Node // contains filtered or unexported fields }
func (*SetStructNode) Args ¶
func (s *SetStructNode) Args() []Node
type SwitchNode ¶
type TypedValue ¶
type TypedValue struct {
// contains filtered or unexported fields
}
func (*TypedValue) Args ¶
func (t *TypedValue) Args() []Node
func (*TypedValue) Type ¶
func (t *TypedValue) Type() types.Type
Click to show internal directories.
Click to hide internal directories.