@@ -59,9 +59,9 @@ type NilNode struct {
59
59
type IdentifierNode struct {
60
60
base
61
61
Value string // Name of the identifier. Like "foo" in "foo.bar".
62
- FieldIndex []int // Index of the field in the list of fields.
63
- Method bool // If true then the identifier is a method call.
64
- MethodIndex int // Index of the method in the list of methods.
62
+ FieldIndex []int // Internal. Index of the field in the list of fields.
63
+ Method bool // Internal. If true then the identifier is a method call.
64
+ MethodIndex int // Internal. Index of the method in the list of methods.
65
65
}
66
66
67
67
// SetFieldIndex sets the field index of the identifier.
@@ -118,10 +118,10 @@ type UnaryNode struct {
118
118
// BinaryNode represents a binary operator.
119
119
type BinaryNode struct {
120
120
base
121
- Regexp * regexp.Regexp // Regexp of the "matches" operator. Like "f.+" in `foo matches "f.+"`.
122
121
Operator string // Operator of the binary operator. Like "+" in "foo + bar" or "matches" in "foo matches bar".
123
122
Left Node // Left node of the binary operator.
124
123
Right Node // Right node of the binary operator.
124
+ Regexp * regexp.Regexp // Internal. Regexp of the "matches" operator. Like "f.+" in `foo matches "f.+"`.
125
125
}
126
126
127
127
// ChainNode represents an optional chaining group.
@@ -149,13 +149,13 @@ type MemberNode struct {
149
149
base
150
150
Node Node // Node of the member access. Like "foo" in "foo.bar".
151
151
Property Node // Property of the member access. For property access it is a StringNode.
152
- Name string // Name of the filed or method. Used for error reporting.
153
152
Optional bool // If true then the member access is optional. Like "foo?.bar".
154
- FieldIndex []int // Index sequence of fields. Generated by type checker.
153
+ Name string // Internal. Name of the filed or method. Used for error reporting.
154
+ FieldIndex []int // Internal. Index sequence of fields. Generated by type checker.
155
155
156
156
// TODO: Combine Method and MethodIndex into a single MethodIndex field of &int type.
157
- Method bool // If true then the member access is a method call.
158
- MethodIndex int // Index of the method in the list of methods. Generated by type checker.
157
+ Method bool // Internal. If true then the member access is a method call.
158
+ MethodIndex int // Internal. Index of the method in the list of methods. Generated by type checker.
159
159
}
160
160
161
161
// SetFieldIndex sets the field index of the member access.
@@ -186,18 +186,18 @@ type CallNode struct {
186
186
base
187
187
Callee Node // Node of the call. Like "foo" in "foo()".
188
188
Arguments []Node // Arguments of the call.
189
- Typed int // If more than 0 then the call is one of the types from vm.FuncTypes.
190
- Fast bool // If true then the call type is "func(...any) any" .
191
- Func * Function // If not nil then the func is provider via expr.Function .
189
+ Typed int // Internal. Used to indicate compiler what type is one of vm.FuncTypes.
190
+ Fast bool // Internal. Used to indicate compiler what this call is a fast call .
191
+ Func * Function // Internal. Used to pass function information from type checker to compiler .
192
192
}
193
193
194
194
// BuiltinNode represents a builtin function call.
195
195
type BuiltinNode struct {
196
196
base
197
197
Name string // Name of the builtin function. Like "len" in "len(foo)".
198
198
Arguments []Node // Arguments of the builtin function.
199
- Throws bool // If true then accessing a field or array index can throw an error. Used by optimizer.
200
- Map Node // Used by optimizer to fold filter() and map() builtins.
199
+ Throws bool // Internal. If true then accessing a field or array index can throw an error. Used by optimizer.
200
+ Map Node // Internal. Used by optimizer to fold filter() and map() builtins.
201
201
}
202
202
203
203
// ClosureNode represents a predicate.
0 commit comments