Make the compile function plain C and take a JSON grammar

This commit is contained in:
Max Brunsfeld 2016-01-10 20:04:41 -08:00
parent b69e19c525
commit d4632ab9a9
54 changed files with 325 additions and 234 deletions

View file

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