tree-sitter/spec/runtime/languages/arithmetic/errors.txt
Max Brunsfeld 1e79ed794b Allow multiple top-level nodes
Now, the root node of a document is always a document node.
It will often have only one child node which corresponds to the grammar's
start symbol, but not always. Currently, it may have more than one child
if there are ubiquitous tokens such as comments at the beginning of the
document. In the future, it will also be possible be possible to have multiple
for the document to have multiple children if the document is partially parsed.
2014-08-09 00:00:20 -07:00

15 lines
430 B
Text

=====================================================
recovers from errors at the top level
=====================================================
x * * y
---
(variable) (ERROR '*')
=====================================================
recovers from errors inside parenthesized expressions
=====================================================
x + (y * + z) * 5
---
(sum
(variable)
(product (group (ERROR '+')) (number)))