Documentation
¶
Index ¶
- func Dump(node Node) string
- func Patch(node *Node, newNode Node)
- func Walk(node *Node, v Visitor)
- type ArrayNode
- type BinaryNode
- type BoolNode
- type BuiltinNode
- type CallNode
- type ChainNode
- type ClosureNode
- type ConditionalNode
- type ConstantNode
- type FloatNode
- type Function
- type IdentifierNode
- type IntegerNode
- type MapNode
- type MemberNode
- type NilNode
- type Node
- type PairNode
- type PointerNode
- type SliceNode
- type StringNode
- type UnaryNode
- type VariableDeclaratorNode
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArrayNode ¶
type ArrayNode struct {
Nodes []Node
// contains filtered or unexported fields
}
func (*ArrayNode) SetLocation ¶
type BinaryNode ¶
type BinaryNode struct {
Regexp *regexp.Regexp
Operator string
Left Node
Right Node
// contains filtered or unexported fields
}
func (*BinaryNode) SetLocation ¶
func (*BinaryNode) String ¶ added in v0.0.4
func (n *BinaryNode) String() string
type BoolNode ¶
type BoolNode struct {
Value bool
// contains filtered or unexported fields
}
func (*BoolNode) SetLocation ¶
type BuiltinNode ¶
type BuiltinNode struct {
Name string
Arguments []Node
Throws bool
Map Node
// contains filtered or unexported fields
}
func (*BuiltinNode) SetLocation ¶
func (*BuiltinNode) String ¶ added in v0.0.4
func (n *BuiltinNode) String() string
type CallNode ¶
type CallNode struct {
Callee Node
Arguments []Node
Typed int
Fast bool
Func *Function
// contains filtered or unexported fields
}
func (*CallNode) SetLocation ¶
type ChainNode ¶
type ChainNode struct {
Node Node
// contains filtered or unexported fields
}
func (*ChainNode) SetLocation ¶
type ClosureNode ¶
type ClosureNode struct {
Node Node
// contains filtered or unexported fields
}
func (*ClosureNode) SetLocation ¶
func (*ClosureNode) String ¶ added in v0.0.4
func (n *ClosureNode) String() string
type ConditionalNode ¶
type ConditionalNode struct {
Cond Node
Exp1 Node
Exp2 Node
// contains filtered or unexported fields
}
func (*ConditionalNode) SetLocation ¶
func (*ConditionalNode) String ¶ added in v0.0.4
func (n *ConditionalNode) String() string
type ConstantNode ¶
type ConstantNode struct {
Value any
// contains filtered or unexported fields
}
func (*ConstantNode) SetLocation ¶
func (*ConstantNode) String ¶ added in v0.0.4
func (n *ConstantNode) String() string
type FloatNode ¶
type FloatNode struct {
Value float64
// contains filtered or unexported fields
}
func (*FloatNode) SetLocation ¶
type IdentifierNode ¶
type IdentifierNode struct {
Value string
FieldIndex []int
Method bool // true if method, false if field
MethodIndex int // index of method, set only if Method is true
// contains filtered or unexported fields
}
func (*IdentifierNode) SetLocation ¶
func (*IdentifierNode) String ¶ added in v0.0.4
func (n *IdentifierNode) String() string
type IntegerNode ¶
type IntegerNode struct {
Value int
// contains filtered or unexported fields
}
func (*IntegerNode) SetLocation ¶
func (*IntegerNode) String ¶ added in v0.0.4
func (n *IntegerNode) String() string
type MapNode ¶
type MapNode struct {
Pairs []Node
// contains filtered or unexported fields
}
func (*MapNode) SetLocation ¶
type MemberNode ¶
type MemberNode struct {
Node Node
Property Node
Name string // Name of the filed or method. Used for error reporting.
Optional bool
FieldIndex []int
// TODO: Combine Method and MethodIndex into a single MethodIndex field of &int type.
Method bool
MethodIndex int
// contains filtered or unexported fields
}
func (*MemberNode) SetLocation ¶
func (*MemberNode) String ¶ added in v0.0.4
func (n *MemberNode) String() string
type NilNode ¶
type NilNode struct {
// contains filtered or unexported fields
}
func (*NilNode) SetLocation ¶
type Node ¶
type Node interface {
Location() file.Location
SetLocation(file.Location)
Type() reflect.Type
SetType(reflect.Type)
String() string
}
Node represents items of abstract syntax tree.
type PairNode ¶
func (*PairNode) SetLocation ¶
type PointerNode ¶
type PointerNode struct {
Name string
// contains filtered or unexported fields
}
func (*PointerNode) SetLocation ¶
func (*PointerNode) String ¶ added in v0.0.4
func (n *PointerNode) String() string
type SliceNode ¶
func (*SliceNode) SetLocation ¶
type StringNode ¶
type StringNode struct {
Value string
// contains filtered or unexported fields
}
func (*StringNode) SetLocation ¶
func (*StringNode) String ¶ added in v0.0.4
func (n *StringNode) String() string
type UnaryNode ¶
func (*UnaryNode) SetLocation ¶
type VariableDeclaratorNode ¶ added in v0.0.4
type VariableDeclaratorNode struct {
Name string
Value Node
Expr Node
// contains filtered or unexported fields
}
func (*VariableDeclaratorNode) SetLocation ¶ added in v0.0.4
func (*VariableDeclaratorNode) String ¶ added in v0.0.4
func (n *VariableDeclaratorNode) String() string
Click to show internal directories.
Click to hide internal directories.