Fix javascript error test

A single line with two function declarations now parses
successfully, so to create the desired error recovery
scenario, wrap the two functions in an assignment
This commit is contained in:
Max Brunsfeld 2016-11-30 23:19:34 -08:00
parent cfef576a9f
commit d627042fa6

View file

@ -43,7 +43,7 @@ one invalid subtree right after the viable prefix
===================================================
if ({a: 'b'} {c: 'd'}) {
function(a) { b; } function(c) { d; }
x = function(a) { b; } function(c) { d; }
}
---
@ -53,13 +53,14 @@ if ({a: 'b'} {c: 'd'}) {
(object (pair (identifier) (string)))
(ERROR (object (pair (identifier) (string))))
(statement_block
(ERROR (function
(formal_parameters (identifier))
(statement_block (expression_statement (identifier)))))
(expression_statement
(expression_statement (assignment
(identifier)
(ERROR (function
(formal_parameters (identifier))
(statement_block (expression_statement (identifier)))))
(function
(formal_parameters (identifier))
(statement_block (expression_statement (identifier))))))))
(statement_block (expression_statement (identifier)))))))))
===================================================
one invalid token at the end of the file