Documentation ¶
Index ¶
- func PrintTree(node Node)
- func Traverse(node Node, f TraverseFn)
- type Access
- type Assignment
- type Block
- type Boolean
- type Break
- type Call
- type Continue
- type DataDef
- type Dict
- type For
- type FunctionDef
- type Identifier
- type If
- type Index
- type InfixOperator
- type Instantiate
- type InternalNode
- type List
- type Match
- type Node
- type Number
- type Pipe
- type PrefixOperator
- type Raise
- type Return
- type Spread
- type String
- type TraverseFn
- type Tuple
- type Unwrap
- type WalkFn
- type With
- type Wrap
- type Yield
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Traverse ¶
func Traverse(node Node, f TraverseFn)
Types ¶
type Assignment ¶
func (*Assignment) Children ¶
func (n *Assignment) Children() []Node
func (*Assignment) GetToken ¶
func (n *Assignment) GetToken() *tokens.Token
func (*Assignment) String ¶
func (n *Assignment) String() string
func (*Assignment) Walk ¶
func (n *Assignment) Walk(fn WalkFn)
type Break ¶
type Break struct { *InternalNode Token *tokens.Token }
type Call ¶
type Call struct { *InternalNode Token *tokens.Token Target Node Arguments []Node }
Represent a function or type call, i.e., any `identifier(<expression>, ...)`
type Continue ¶
type Continue struct { *InternalNode Token *tokens.Token }
type DataDef ¶
type DataDef struct { *InternalNode Token *tokens.Token Name string Extensions []Node Attributes map[string]Node Methods map[string]Node }
Represent a function definition `fn name() {}`
type Dict ¶
type Dict struct { *InternalNode Token *tokens.Token Elements []Node }
Represents the dict creation `{a=1, b=2, ...}` Elements are a list of [key, value, key, value, ...] pairs
type For ¶
type FunctionDef ¶
type FunctionDef struct { *InternalNode Token *tokens.Token Name string Parameters []Node Body Node Generator bool }
Represent a function definition `fn name() {}`
func (*FunctionDef) Children ¶
func (n *FunctionDef) Children() []Node
func (*FunctionDef) GetToken ¶
func (n *FunctionDef) GetToken() *tokens.Token
func (*FunctionDef) String ¶
func (n *FunctionDef) String() string
func (*FunctionDef) Walk ¶
func (n *FunctionDef) Walk(fn WalkFn)
type Identifier ¶
type Identifier struct { *InternalNode Token *tokens.Token Value string }
func (*Identifier) Children ¶
func (n *Identifier) Children() []Node
func (*Identifier) GetToken ¶
func (n *Identifier) GetToken() *tokens.Token
func (*Identifier) String ¶
func (n *Identifier) String() string
func (*Identifier) Walk ¶
func (n *Identifier) Walk(fn WalkFn)
type If ¶
type Index ¶
type Index struct { *InternalNode Token *tokens.Token Target Node Index Node }
Represents access like `a[0]` and `a[a, b]`
type InfixOperator ¶
type InfixOperator struct { *InternalNode Token *tokens.Token Operator string Left Node Right Node }
func (*InfixOperator) Children ¶
func (n *InfixOperator) Children() []Node
func (*InfixOperator) GetToken ¶
func (n *InfixOperator) GetToken() *tokens.Token
func (*InfixOperator) String ¶
func (n *InfixOperator) String() string
func (*InfixOperator) Walk ¶
func (n *InfixOperator) Walk(fn WalkFn)
type Instantiate ¶
type Instantiate struct { *InternalNode Token *tokens.Token Target Node Elements []Node }
Represents an instantiation of a type. `CustomType { x=2 }`
func (*Instantiate) Children ¶
func (n *Instantiate) Children() []Node
func (*Instantiate) GetToken ¶
func (n *Instantiate) GetToken() *tokens.Token
func (*Instantiate) String ¶
func (n *Instantiate) String() string
func (*Instantiate) Walk ¶
func (n *Instantiate) Walk(fn WalkFn)
type InternalNode ¶
type InternalNode struct {
// contains filtered or unexported fields
}
func (*InternalNode) Parent ¶
func (n *InternalNode) Parent() Node
func (*InternalNode) SetParent ¶
func (n *InternalNode) SetParent(parent Node)
func (*InternalNode) SetSourcePath ¶
func (n *InternalNode) SetSourcePath(path string)
func (*InternalNode) SourcePath ¶
func (n *InternalNode) SourcePath() string
type List ¶
type List struct { *InternalNode Token *tokens.Token Elements []Node }
Represents the list creation `[1, 2, ...]`
type Match ¶
type Match struct { *InternalNode Token *tokens.Token Expression Node Cases []Node // [condition, expression, condition, expression, ...] }
type PrefixOperator ¶
type PrefixOperator struct { *InternalNode Token *tokens.Token Operator string Right Node }
func (*PrefixOperator) Children ¶
func (n *PrefixOperator) Children() []Node
func (*PrefixOperator) GetToken ¶
func (n *PrefixOperator) GetToken() *tokens.Token
func (*PrefixOperator) String ¶
func (n *PrefixOperator) String() string
func (*PrefixOperator) Walk ¶
func (n *PrefixOperator) Walk(fn WalkFn)
type TraverseFn ¶
Source Files ¶
- access.go
- assignment.go
- ast.go
- block.go
- boolean.go
- break.go
- call.go
- continue.go
- data-def.go
- dict.go
- for.go
- function-def.go
- identifier.go
- if.go
- index.go
- infix-operator.go
- instantiate.go
- list.go
- match.go
- number.go
- pipe.go
- prefix-operator.go
- raise.go
- return.go
- spread.go
- string.go
- tuple.go
- unwrap.go
- with.go
- wrap.go
- yield.go
Click to show internal directories.
Click to hide internal directories.