Preserve tokens within errors

This commit is contained in:
Max Brunsfeld 2015-06-15 15:24:15 -07:00
parent 0c4620f3ab
commit 3d0890eecf
9 changed files with 89 additions and 112 deletions

View file

@ -6,7 +6,7 @@ stuff(|||);
---
(expression_statement (function_call (identifier) (ERROR '|')))
(expression_statement (function_call (identifier) (ERROR (UNEXPECTED '|'))))
==========================================
errors in if statements
@ -21,8 +21,9 @@ moreStuff();
---
(program
(expression_statement (function_call (identifier)))
(if_statement (ERROR '*')
(statement_block (expression_statement (ERROR '*'))))
(expression_statement (function_call (identifier))))
(expression_statement (function_call (identifier)))
(if_statement
(ERROR (UNEXPECTED '*') (identifier))
(statement_block
(expression_statement (ERROR (UNEXPECTED '*') (identifier) (identifier)))))
(expression_statement (function_call (identifier))))