Node represents a node in the AST.
| 31 | |
| 32 | // Node represents a node in the AST. |
| 33 | type Node interface { |
| 34 | Context() Context |
| 35 | Loc() *LocationRange |
| 36 | FreeVariables() Identifiers |
| 37 | SetFreeVariables(Identifiers) |
| 38 | SetContext(Context) |
| 39 | // OpenFodder returns the fodder before the first token of an AST node. |
| 40 | // Since every AST node has opening fodder, it is defined here. |
| 41 | // If the AST node is left recursive (e.g. BinaryOp) then it is ambiguous |
| 42 | // where the fodder should be stored. This is resolved by storing it as |
| 43 | // far inside the tree as possible. OpenFodder returns a pointer to allow |
| 44 | // the caller to modify the fodder. |
| 45 | OpenFodder() *Fodder |
| 46 | } |
| 47 | |
| 48 | // Nodes represents a Node slice. |
| 49 | type Nodes []Node |
no outgoing calls
no test coverage detected
searching dependent graphs…