tree-sitter/spec/runtime/languages/javascript/errors.txt

41 lines
1.1 KiB
Text
Raw Normal View History

==========================================
recovers from errors in function calls
==========================================
stuff(|||);
---
(program (expression_statement (function_call (identifier) (ERROR '|'))))
==========================================
recovers from errors in if statements
==========================================
stuff();
if (*nonsense*) {
*more-nonsense*;
}
moreStuff();
---
(program
2014-03-28 12:59:47 -07:00
(expression_statement (function_call (identifier)))
(if_statement (ERROR '*')
(statement_block (expression_statement (ERROR '*'))))
2014-03-28 12:59:47 -07:00
(expression_statement (function_call (identifier))))
==========================================
recovers from errors in for loops
==========================================
stuff();
for (var i = 0; *nonsense*; i++) {
*more-nonsense*;
}
moreStuff();
---
(program
(expression_statement (function_call (identifier)))
(for_statement
(var_declaration (assignment (identifier) (number)))
(expression_statement (ERROR '*'))
(math_op (identifier))
(statement_block (expression_statement (ERROR '*'))))
(expression_statement (function_call (identifier))))