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
|
|
@ -39,7 +39,7 @@ var x = {
|
|||
(statement_block (var_declaration (identifier) (identifier)))))))
|
||||
|
||||
==========================================
|
||||
parses comments. TODO - leading comments
|
||||
parses comments
|
||||
==========================================
|
||||
// this is the beginning of the script.
|
||||
// here we go.
|
||||
|
|
@ -54,6 +54,8 @@ var thing = {
|
|||
}
|
||||
};
|
||||
---
|
||||
(comment)
|
||||
(comment)
|
||||
(program
|
||||
(var_declaration (identifier) (object
|
||||
(comment)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue