SexpOptionsinterfaceno test imports itinterface SexpOptionsWhat toSexp may be asked.
| Member | Type | What it is |
|---|---|---|
spans? | boolean | Write each node's range after its kind. |
A tree as text (commons lang-sql 0002-sql-ast-parser FR-017): one node to a line, indented, each field in the order the node declares it, the same text for the same tree. It is what the golden files of the parser hold, so that a change of the grammar shows as a difference of text.
toSexp(parse("select 1").script);
// script
// statements[0]: select distinct=false
// items[0]: select-item
// expr: number text="1"Spec: 0002-sql-ast-parser FR-017
SexpOptionsinterfaceno test imports itinterface SexpOptionsWhat toSexp may be asked.
| Member | Type | What it is |
|---|---|---|
spans? | boolean | Write each node's range after its kind. |
toSexpfunctionfunction toSexp(node: Node, options?: SexpOptions): stringWrites a tree as text.
| Parameter | What it is |
|---|---|
node | the tree |
options | whether to write ranges |
Returns: the text, with no newline at its end