@@ -59,9 +59,9 @@ type NilNode struct {
5959type IdentifierNode struct {
6060 base
6161 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.
6565}
6666
6767// SetFieldIndex sets the field index of the identifier.
@@ -118,10 +118,10 @@ type UnaryNode struct {
118118// BinaryNode represents a binary operator.
119119type BinaryNode struct {
120120 base
121- Regexp * regexp.Regexp // Regexp of the "matches" operator. Like "f.+" in `foo matches "f.+"`.
122121 Operator string // Operator of the binary operator. Like "+" in "foo + bar" or "matches" in "foo matches bar".
123122 Left Node // Left node of the binary operator.
124123 Right Node // Right node of the binary operator.
124+ Regexp * regexp.Regexp // Internal. Regexp of the "matches" operator. Like "f.+" in `foo matches "f.+"`.
125125}
126126
127127// ChainNode represents an optional chaining group.
@@ -149,13 +149,13 @@ type MemberNode struct {
149149 base
150150 Node Node // Node of the member access. Like "foo" in "foo.bar".
151151 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.
153152 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.
155155
156156 // 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.
159159}
160160
161161// SetFieldIndex sets the field index of the member access.
@@ -186,18 +186,18 @@ type CallNode struct {
186186 base
187187 Callee Node // Node of the call. Like "foo" in "foo()".
188188 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 .
192192}
193193
194194// BuiltinNode represents a builtin function call.
195195type BuiltinNode struct {
196196 base
197197 Name string // Name of the builtin function. Like "len" in "len(foo)".
198198 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.
201201}
202202
203203// ClosureNode represents a predicate.
0 commit comments