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.
This commit is contained in:
parent
9302080aa6
commit
1e79ed794b
17 changed files with 78 additions and 39 deletions
|
|
@ -50,7 +50,8 @@ TSNode *ts_document_root_node(const TSDocument *);
|
|||
|
||||
#define ts_builtin_sym_error 0
|
||||
#define ts_builtin_sym_end 1
|
||||
#define ts_start_sym 2
|
||||
#define ts_builtin_sym_document 2
|
||||
#define ts_builtin_sym_start 3
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue