tree-sitter/spec/runtime/languages/json/errors.txt
Max Brunsfeld b91f48ced2 Call handle_error even when error occurs exactly where expected
Previously, if an error happened right at the beginning of an error
production, the error node would be immediately shifted onto the stack
without calling the error handling function.
2014-08-27 18:44:27 -07:00

40 lines
923 B
Text

==========================================
recovers from top-level errors
==========================================
[}
---
(ERROR '}')
==========================================
recovers from unexpected tokens
==========================================
barf
---
(ERROR 'b')
==========================================
recovers from errors inside arrays
==========================================
[1, , 2]
---
(array
(number)
(ERROR ',')
(number))
==========================================
recovers from errors inside objects
==========================================
{ "key1": 1, oops }
---
(object (string) (number) (ERROR 'o'))
==========================================
recovers from errors inside nested objects
==========================================
{ "key1": { "key2": 1, 2 }, [, "key3": 3 }
---
(object
(string) (object (string) (number) (ERROR '2'))
(ERROR '[')
(string) (number))