new AST()
The AST builder class
Properties:
| Name | Type | Description |
|---|---|---|
withPositions |
Boolean |
Should locate any node (by default false) |
withSource |
Boolean |
Should extract the node original code (by default false) |
Methods
prepare(kind, parser) → {function}
Prepares an AST node
Parameters:
| Name | Type | Description |
|---|---|---|
kind |
String | null |
Defines the node type (if null, the kind must be passed at the function call) |
parser |
Parser |
The parser instance (use for extracting locations) |
resolveLocations()
Includes locations from first & last into the target
resolvePrecedence()
Check and fix precence, by default using right
swapLocations()
Change parent node informations after swapping childs