Simplify handling of multiple top-level nodes after parsing

This commit is contained in:
Max Brunsfeld 2014-07-14 20:46:20 -07:00
parent 4d17da159f
commit 6e551d6d9f
4 changed files with 13 additions and 28 deletions

View file

@ -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))))

View file

@ -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.

View file

@ -3,7 +3,7 @@ recovers from top-level errors
==========================================
[}
---
(ERROR '}')
(value (ERROR <EOF>) (ERROR '}'))
==========================================
recovers from unexpected tokens