Simplify handling of multiple top-level nodes after parsing
This commit is contained in:
parent
4d17da159f
commit
6e551d6d9f
4 changed files with 13 additions and 28 deletions
|
|
@ -3,7 +3,7 @@ recovers from errors at the top level
|
|||
=====================================================
|
||||
x * * y
|
||||
---
|
||||
(ERROR '*')
|
||||
(expression (variable) (ERROR '*'))
|
||||
|
||||
=====================================================
|
||||
recovers from errors inside parenthesized expressions
|
||||
|
|
@ -12,4 +12,4 @@ x + (y * + z) * 5
|
|||
---
|
||||
(expression (sum
|
||||
(variable)
|
||||
(product (group (ERROR '+')) (number))))
|
||||
(product (group (ERROR '+')) (number))))
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ var x = {
|
|||
(statement_block (var_declaration (identifier) (identifier)))))))
|
||||
|
||||
==========================================
|
||||
parses comments
|
||||
parses comments z
|
||||
==========================================
|
||||
// this is the beginning of the script.
|
||||
// here we go.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ recovers from top-level errors
|
|||
==========================================
|
||||
[}
|
||||
---
|
||||
(ERROR '}')
|
||||
(value (ERROR <EOF>) (ERROR '}'))
|
||||
|
||||
==========================================
|
||||
recovers from unexpected tokens
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue