mirror of
https://github.com/ribru17/ts_query_ls.git
synced 2025-12-23 05:36:52 +00:00
13 lines
574 B
Markdown
13 lines
574 B
Markdown
## The `MISSING` Node
|
|
|
|
If the parser is able to recover from erroneous text by inserting a missing
|
|
token and then reducing, it will insert that missing node in the final tree so
|
|
long as that tree has the lowest error cost. These missing nodes appear as
|
|
seemingly normal nodes in the tree, but they are zero tokens wide, and are
|
|
internally represented as a property of the actual terminal node that was
|
|
inserted, instead of being its own kind of node, like the `ERROR` node. These
|
|
special missing nodes can be queried using `(MISSING)`:
|
|
|
|
```query
|
|
(MISSING) @missing-node
|
|
```
|