Rewind and re-tokenize in error mode after detecting an error

This commit is contained in:
Max Brunsfeld 2016-06-17 21:26:03 -07:00
parent 76975f56ec
commit 94721c7ec0
4 changed files with 20 additions and 14 deletions

View file

@ -192,8 +192,7 @@ class CCodeGenerator {
void add_lex_function() {
line(
"static void ts_lex(TSLexer *lexer, TSStateId state, bool error_mode) "
"{");
"static bool ts_lex(TSLexer *lexer, TSStateId state, bool error_mode) {");
indent([&]() {
line("START_LEXER();");
_switch("state", [&]() {