Improve parser error messages

This commit is contained in:
Max Brunsfeld 2014-01-09 13:31:30 -08:00
parent 55809f702d
commit 2894ad7447
4 changed files with 62 additions and 35 deletions

View file

@ -14,7 +14,7 @@ typedef struct TSStackEntry TSStackEntry;
typedef struct TSParser {
TSTree *tree;
const char *input;
char *error_message;
const char *error_message;
size_t position;
TSTree *lookahead_node;
TSState lex_state;
@ -47,7 +47,7 @@ next_state:
ts_symbol_names[LOOKAHEAD_SYM()]
#define START_LEXER() \
if (LOOKAHEAD_SYM() > 0) return; \
if (LOOKAHEAD_SYM() >= 0) return; \
if (LOOKAHEAD_CHAR() == '\0') { ACCEPT_TOKEN(ts_symbol___END__); } \
next_state: