Generate parser

This commit is contained in:
jonatanklosko 2021-10-04 08:26:45 +00:00 committed by GitHub Actions
parent ab50f8bbda
commit 7ae20df181
2 changed files with 99 additions and 50 deletions

2
src/grammar.json generated
View File

@ -2128,7 +2128,7 @@
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "PATTERN",
"value": "[a-zA-Z]+"
"value": "[a-zA-Z0-9]+"
}
},
"named": true,

147
src/parser.c generated
View File

@ -11312,7 +11312,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(108)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 108:
@ -11382,7 +11383,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(111)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 111:
@ -11451,7 +11453,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(114)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 114:
@ -11555,7 +11558,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(119)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 119:
@ -11622,7 +11626,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(122)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 122:
@ -11688,7 +11693,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(125)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 125:
@ -11849,7 +11855,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(133)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 133:
@ -11912,7 +11919,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(136)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 136:
@ -11976,7 +11984,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(139)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 139:
@ -12038,7 +12047,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(142)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 142:
@ -12921,7 +12931,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(265)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 265:
@ -12991,7 +13002,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '~') ADVANCE(187);
if (lookahead == '\t' ||
lookahead == ' ') SKIP(267)
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 267:
@ -14369,164 +14381,191 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 473:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'a') ADVANCE(496);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('b' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 474:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'c') ADVANCE(498);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 475:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'c') ADVANCE(484);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 476:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'd') ADVANCE(565);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 477:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'd') ADVANCE(650);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 478:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'e') ADVANCE(646);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 479:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'e') ADVANCE(656);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 480:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'e') ADVANCE(489);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 481:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'e') ADVANCE(493);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 482:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'e') ADVANCE(494);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 483:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'f') ADVANCE(497);
if (lookahead == 'n') ADVANCE(476);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 484:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'h') ADVANCE(638);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 485:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'h') ADVANCE(480);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 486:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'l') ADVANCE(495);
if (lookahead == 'n') ADVANCE(477);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 487:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'n') ADVANCE(476);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 488:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'n') ADVANCE(601);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 489:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'n') ADVANCE(542);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 490:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'n') ADVANCE(477);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 491:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'o') ADVANCE(642);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 492:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'r') ADVANCE(557);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 493:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'r') ADVANCE(634);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 494:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 's') ADVANCE(474);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 495:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 's') ADVANCE(478);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 496:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 't') ADVANCE(475);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 497:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 't') ADVANCE(481);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 498:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (lookahead == 'u') ADVANCE(479);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 499:
ACCEPT_TOKEN(aux_sym_sigil_token3);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 500:
@ -14707,7 +14746,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 542:
ACCEPT_TOKEN(anon_sym_when);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 543:
@ -14779,7 +14819,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 557:
ACCEPT_TOKEN(anon_sym_or);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 558:
@ -14817,7 +14858,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 565:
ACCEPT_TOKEN(anon_sym_and);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 566:
@ -14959,7 +15001,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 601:
ACCEPT_TOKEN(anon_sym_in);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 602:
@ -15094,7 +15137,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 634:
ACCEPT_TOKEN(anon_sym_after);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 635:
@ -15116,7 +15160,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 638:
ACCEPT_TOKEN(anon_sym_catch);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 639:
@ -15138,7 +15183,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 642:
ACCEPT_TOKEN(anon_sym_do);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 643:
@ -15160,7 +15206,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 646:
ACCEPT_TOKEN(anon_sym_else);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 647:
@ -15182,7 +15229,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 650:
ACCEPT_TOKEN(anon_sym_end);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 651:
@ -15218,7 +15266,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 656:
ACCEPT_TOKEN(anon_sym_rescue);
if (('A' <= lookahead && lookahead <= 'Z') ||
if (('0' <= lookahead && lookahead <= '9') ||
('A' <= lookahead && lookahead <= 'Z') ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(499);
END_STATE();
case 657: