Add error recovery to for loops in javascript grammar

This commit is contained in:
Max Brunsfeld 2014-03-28 13:11:12 -07:00
parent 2e11f60710
commit 324f55f1ce
3 changed files with 2420 additions and 2272 deletions

View file

@ -10,5 +10,24 @@ moreStuff();
(program
(expression_statement (function_call (identifier)))
(if_statement (ERROR)
(statement_block (ERROR)))
(statement_block (expression_statement (ERROR))))
(expression_statement (function_call (identifier))))
==========================================
recovers from errors in for loops
==========================================
stuff();
for (var i = 0; *nonsense*; *what*) {
*more-nonsense*;
}
moreStuff();
---
(program
(expression_statement (function_call (identifier)))
(for_statement
(var_declaration (assignment (identifier) (number)))
(expression_statement (ERROR))
(ERROR)
(statement_block (expression_statement (ERROR))))
(expression_statement (function_call (identifier))))