1
0

Improve identifier regex

This commit is contained in:
Jeff 2023-12-31 11:03:33 -05:00
parent 12e00bfc42
commit 2fee80843d
4 changed files with 172 additions and 171 deletions

View File

@ -5,6 +5,7 @@ Simple Identifiers
x x
_y _y
__xyz__ __xyz__
x123x
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -15,6 +16,9 @@ __xyz__
(statement (statement
(expression (expression
(identifier))) (identifier)))
(statement
(expression
(identifier)))
(statement (statement
(expression (expression
(identifier)))) (identifier))))

View File

@ -77,7 +77,7 @@ module.exports = grammar({
), ),
_identifier_pattern: $ => _identifier_pattern: $ =>
/[_a-zA-Z]+[_a-zA-Z0-9]?/, /[_a-zA-Z]+[_a-zA-Z0-9]*[_a-zA-Z]?/,
value: $ => value: $ =>
choice( choice(

View File

@ -217,7 +217,7 @@
}, },
"_identifier_pattern": { "_identifier_pattern": {
"type": "PATTERN", "type": "PATTERN",
"value": "[_a-zA-Z]+[_a-zA-Z0-9]?" "value": "[_a-zA-Z]+[_a-zA-Z0-9]*[_a-zA-Z]?"
}, },
"value": { "value": {
"type": "CHOICE", "type": "CHOICE",

View File

@ -1252,28 +1252,28 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '"') ADVANCE(6); if (lookahead == '"') ADVANCE(6);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '\'') ADVANCE(9); if (lookahead == '\'') ADVANCE(9);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == ')') ADVANCE(33); if (lookahead == ')') ADVANCE(33);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(56); if (lookahead == '+') ADVANCE(55);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(59); if (lookahead == '-') ADVANCE(58);
if (lookahead == '.') ADVANCE(10); if (lookahead == '.') ADVANCE(10);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(52); if (lookahead == '=') ADVANCE(51);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '[') ADVANCE(49); if (lookahead == '[') ADVANCE(48);
if (lookahead == ']') ADVANCE(50); if (lookahead == ']') ADVANCE(49);
if (lookahead == '`') ADVANCE(15); if (lookahead == '`') ADVANCE(15);
if (lookahead == 'a') ADVANCE(42); if (lookahead == 'a') ADVANCE(41);
if (lookahead == 'e') ADVANCE(40); if (lookahead == 'e') ADVANCE(39);
if (lookahead == '{') ADVANCE(29); if (lookahead == '{') ADVANCE(29);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
if (lookahead == '}') ADVANCE(30); if (lookahead == '}') ADVANCE(30);
@ -1282,31 +1282,31 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '\r' || lookahead == '\r' ||
lookahead == ' ') SKIP(0) lookahead == ' ') SKIP(0)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('_' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('_' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 1: case 1:
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '"') ADVANCE(6); if (lookahead == '"') ADVANCE(6);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '\'') ADVANCE(9); if (lookahead == '\'') ADVANCE(9);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == ')') ADVANCE(33); if (lookahead == ')') ADVANCE(33);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(56); if (lookahead == '+') ADVANCE(55);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(59); if (lookahead == '-') ADVANCE(58);
if (lookahead == '.') ADVANCE(10); if (lookahead == '.') ADVANCE(10);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(51); if (lookahead == '=') ADVANCE(50);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '[') ADVANCE(49); if (lookahead == '[') ADVANCE(48);
if (lookahead == ']') ADVANCE(50); if (lookahead == ']') ADVANCE(49);
if (lookahead == '`') ADVANCE(15); if (lookahead == '`') ADVANCE(15);
if (lookahead == '{') ADVANCE(29); if (lookahead == '{') ADVANCE(29);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
@ -1316,26 +1316,26 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '\r' || lookahead == '\r' ||
lookahead == ' ') SKIP(1) lookahead == ' ') SKIP(1)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('_' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('_' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 2: case 2:
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == ')') ADVANCE(33); if (lookahead == ')') ADVANCE(33);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(56); if (lookahead == '+') ADVANCE(55);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(57); if (lookahead == '-') ADVANCE(56);
if (lookahead == '.') ADVANCE(10); if (lookahead == '.') ADVANCE(10);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(52); if (lookahead == '=') ADVANCE(51);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '{') ADVANCE(29); if (lookahead == '{') ADVANCE(29);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
if (lookahead == '}') ADVANCE(30); if (lookahead == '}') ADVANCE(30);
@ -1345,24 +1345,24 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == ' ') SKIP(2) lookahead == ' ') SKIP(2)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 3: case 3:
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(56); if (lookahead == '+') ADVANCE(55);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(57); if (lookahead == '-') ADVANCE(56);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(51); if (lookahead == '=') ADVANCE(50);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
if (lookahead == '}') ADVANCE(30); if (lookahead == '}') ADVANCE(30);
if (lookahead == '\t' || if (lookahead == '\t' ||
@ -1371,21 +1371,21 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == ' ') SKIP(3) lookahead == ' ') SKIP(3)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 4: case 4:
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(55); if (lookahead == '+') ADVANCE(54);
if (lookahead == '-') ADVANCE(58); if (lookahead == '-') ADVANCE(57);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(12); if (lookahead == '=') ADVANCE(12);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
if (lookahead == '\t' || if (lookahead == '\t' ||
lookahead == '\n' || lookahead == '\n' ||
@ -1397,16 +1397,16 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '\'') ADVANCE(9); if (lookahead == '\'') ADVANCE(9);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(23); if (lookahead == '-') ADVANCE(23);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '=') ADVANCE(14); if (lookahead == '=') ADVANCE(14);
if (lookahead == '>') ADVANCE(67); if (lookahead == '>') ADVANCE(66);
if (lookahead == '[') ADVANCE(49); if (lookahead == '[') ADVANCE(48);
if (lookahead == '`') ADVANCE(15); if (lookahead == '`') ADVANCE(15);
if (lookahead == 'e') ADVANCE(40); if (lookahead == 'e') ADVANCE(39);
if (lookahead == '{') ADVANCE(29); if (lookahead == '{') ADVANCE(29);
if (lookahead == '}') ADVANCE(30); if (lookahead == '}') ADVANCE(30);
if (lookahead == '\t' || if (lookahead == '\t' ||
@ -1414,10 +1414,10 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '\r' || lookahead == '\r' ||
lookahead == ' ') SKIP(5) lookahead == ' ') SKIP(5)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('_' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('_' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 6: case 6:
if (lookahead == '"') ADVANCE(48); if (lookahead == '"') ADVANCE(47);
if (lookahead != 0) ADVANCE(6); if (lookahead != 0) ADVANCE(6);
END_STATE(); END_STATE();
case 7: case 7:
@ -1426,49 +1426,49 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == ')') ADVANCE(33); if (lookahead == ')') ADVANCE(33);
if (lookahead == ',') ADVANCE(34); if (lookahead == ',') ADVANCE(34);
if (lookahead == '-') ADVANCE(13); if (lookahead == '-') ADVANCE(13);
if (lookahead == '>') ADVANCE(67); if (lookahead == '>') ADVANCE(66);
if (lookahead == '[') ADVANCE(49); if (lookahead == '[') ADVANCE(48);
if (lookahead == ']') ADVANCE(50); if (lookahead == ']') ADVANCE(49);
if (lookahead == '\t' || if (lookahead == '\t' ||
lookahead == '\n' || lookahead == '\n' ||
lookahead == '\r' || lookahead == '\r' ||
lookahead == ' ') SKIP(7) lookahead == ' ') SKIP(7)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 8: case 8:
if (lookahead == '&') ADVANCE(65); if (lookahead == '&') ADVANCE(64);
END_STATE(); END_STATE();
case 9: case 9:
if (lookahead == '\'') ADVANCE(48); if (lookahead == '\'') ADVANCE(47);
if (lookahead != 0) ADVANCE(9); if (lookahead != 0) ADVANCE(9);
END_STATE(); END_STATE();
case 10: case 10:
if (lookahead == '.') ADVANCE(54); if (lookahead == '.') ADVANCE(53);
END_STATE(); END_STATE();
case 11: case 11:
if (lookahead == '=') ADVANCE(64); if (lookahead == '=') ADVANCE(63);
END_STATE(); END_STATE();
case 12: case 12:
if (lookahead == '=') ADVANCE(63); if (lookahead == '=') ADVANCE(62);
if (lookahead == '>') ADVANCE(75); if (lookahead == '>') ADVANCE(74);
END_STATE(); END_STATE();
case 13: case 13:
if (lookahead == '>') ADVANCE(77); if (lookahead == '>') ADVANCE(76);
END_STATE(); END_STATE();
case 14: case 14:
if (lookahead == '>') ADVANCE(75); if (lookahead == '>') ADVANCE(74);
END_STATE(); END_STATE();
case 15: case 15:
if (lookahead == '`') ADVANCE(48); if (lookahead == '`') ADVANCE(47);
if (lookahead != 0) ADVANCE(15); if (lookahead != 0) ADVANCE(15);
END_STATE(); END_STATE();
case 16: case 16:
if (lookahead == 'f') ADVANCE(19); if (lookahead == 'f') ADVANCE(19);
END_STATE(); END_STATE();
case 17: case 17:
if (lookahead == 'f') ADVANCE(74); if (lookahead == 'f') ADVANCE(73);
END_STATE(); END_STATE();
case 18: case 18:
if (lookahead == 'i') ADVANCE(17); if (lookahead == 'i') ADVANCE(17);
@ -1477,7 +1477,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead == 'o') ADVANCE(20); if (lookahead == 'o') ADVANCE(20);
END_STATE(); END_STATE();
case 20: case 20:
if (lookahead == 'r') ADVANCE(76); if (lookahead == 'r') ADVANCE(75);
END_STATE(); END_STATE();
case 21: case 21:
if (lookahead == '|') ADVANCE(28); if (lookahead == '|') ADVANCE(28);
@ -1486,37 +1486,37 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (lookahead != 0) ADVANCE(21); if (lookahead != 0) ADVANCE(21);
END_STATE(); END_STATE();
case 22: case 22:
if (lookahead == '|') ADVANCE(66); if (lookahead == '|') ADVANCE(65);
END_STATE(); END_STATE();
case 23: case 23:
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
END_STATE(); END_STATE();
case 24: case 24:
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(47); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46);
END_STATE(); END_STATE();
case 25: case 25:
if (eof) ADVANCE(26); if (eof) ADVANCE(26);
if (lookahead == '!') ADVANCE(11); if (lookahead == '!') ADVANCE(11);
if (lookahead == '"') ADVANCE(6); if (lookahead == '"') ADVANCE(6);
if (lookahead == '#') ADVANCE(21); if (lookahead == '#') ADVANCE(21);
if (lookahead == '%') ADVANCE(62); if (lookahead == '%') ADVANCE(61);
if (lookahead == '&') ADVANCE(8); if (lookahead == '&') ADVANCE(8);
if (lookahead == '\'') ADVANCE(9); if (lookahead == '\'') ADVANCE(9);
if (lookahead == '(') ADVANCE(32); if (lookahead == '(') ADVANCE(32);
if (lookahead == '*') ADVANCE(60); if (lookahead == '*') ADVANCE(59);
if (lookahead == '+') ADVANCE(56); if (lookahead == '+') ADVANCE(55);
if (lookahead == '-') ADVANCE(59); if (lookahead == '-') ADVANCE(58);
if (lookahead == '.') ADVANCE(10); if (lookahead == '.') ADVANCE(10);
if (lookahead == '/') ADVANCE(61); if (lookahead == '/') ADVANCE(60);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
if (lookahead == ':') ADVANCE(53); if (lookahead == ':') ADVANCE(52);
if (lookahead == ';') ADVANCE(31); if (lookahead == ';') ADVANCE(31);
if (lookahead == '<') ADVANCE(69); if (lookahead == '<') ADVANCE(68);
if (lookahead == '=') ADVANCE(51); if (lookahead == '=') ADVANCE(50);
if (lookahead == '>') ADVANCE(68); if (lookahead == '>') ADVANCE(67);
if (lookahead == '[') ADVANCE(49); if (lookahead == '[') ADVANCE(48);
if (lookahead == '`') ADVANCE(15); if (lookahead == '`') ADVANCE(15);
if (lookahead == 'a') ADVANCE(42); if (lookahead == 'a') ADVANCE(41);
if (lookahead == '{') ADVANCE(29); if (lookahead == '{') ADVANCE(29);
if (lookahead == '|') ADVANCE(22); if (lookahead == '|') ADVANCE(22);
if (lookahead == '}') ADVANCE(30); if (lookahead == '}') ADVANCE(30);
@ -1525,7 +1525,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == '\r' || lookahead == '\r' ||
lookahead == ' ') SKIP(25) lookahead == ' ') SKIP(25)
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
('_' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('_' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 26: case 26:
ACCEPT_TOKEN(ts_builtin_sym_end); ACCEPT_TOKEN(ts_builtin_sym_end);
@ -1560,195 +1560,192 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE(); END_STATE();
case 35: case 35:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == ' ') ADVANCE(18);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 36: case 36:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == ' ') ADVANCE(18); if (lookahead == ' ') ADVANCE(16);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 37: case 37:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == ' ') ADVANCE(16); if (lookahead == 'c') ADVANCE(36);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 38: case 38:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 'c') ADVANCE(37); if (lookahead == 'e') ADVANCE(35);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 39: case 39:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 'e') ADVANCE(36); if (lookahead == 'l') ADVANCE(42);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 40: case 40:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 'l') ADVANCE(43); if (lookahead == 'n') ADVANCE(37);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 41: case 41:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 'n') ADVANCE(38); if (lookahead == 's') ADVANCE(43);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 42: case 42:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 's') ADVANCE(44); if (lookahead == 's') ADVANCE(38);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 43: case 43:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 's') ADVANCE(39); if (lookahead == 'y') ADVANCE(40);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 44: case 44:
ACCEPT_TOKEN(sym__identifier_pattern); ACCEPT_TOKEN(sym__identifier_pattern);
if (lookahead == 'y') ADVANCE(41); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(44);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35);
if (('A' <= lookahead && lookahead <= 'Z') || if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' || lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45); ('a' <= lookahead && lookahead <= 'z')) ADVANCE(44);
END_STATE(); END_STATE();
case 45: case 45:
ACCEPT_TOKEN(sym__identifier_pattern);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35);
if (('A' <= lookahead && lookahead <= 'Z') ||
lookahead == '_' ||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(45);
END_STATE();
case 46:
ACCEPT_TOKEN(sym_integer); ACCEPT_TOKEN(sym_integer);
if (lookahead == '.') ADVANCE(24); if (lookahead == '.') ADVANCE(24);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
END_STATE();
case 46:
ACCEPT_TOKEN(sym_float);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46);
END_STATE(); END_STATE();
case 47: case 47:
ACCEPT_TOKEN(sym_float);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(47);
END_STATE();
case 48:
ACCEPT_TOKEN(sym_string); ACCEPT_TOKEN(sym_string);
END_STATE(); END_STATE();
case 49: case 48:
ACCEPT_TOKEN(anon_sym_LBRACK); ACCEPT_TOKEN(anon_sym_LBRACK);
END_STATE(); END_STATE();
case 50: case 49:
ACCEPT_TOKEN(anon_sym_RBRACK); ACCEPT_TOKEN(anon_sym_RBRACK);
END_STATE(); END_STATE();
case 50:
ACCEPT_TOKEN(anon_sym_EQ);
if (lookahead == '=') ADVANCE(62);
END_STATE();
case 51: case 51:
ACCEPT_TOKEN(anon_sym_EQ); ACCEPT_TOKEN(anon_sym_EQ);
if (lookahead == '=') ADVANCE(63); if (lookahead == '=') ADVANCE(62);
if (lookahead == '>') ADVANCE(74);
END_STATE(); END_STATE();
case 52: case 52:
ACCEPT_TOKEN(anon_sym_EQ);
if (lookahead == '=') ADVANCE(63);
if (lookahead == '>') ADVANCE(75);
END_STATE();
case 53:
ACCEPT_TOKEN(anon_sym_COLON); ACCEPT_TOKEN(anon_sym_COLON);
END_STATE(); END_STATE();
case 54: case 53:
ACCEPT_TOKEN(anon_sym_DOT_DOT); ACCEPT_TOKEN(anon_sym_DOT_DOT);
END_STATE(); END_STATE();
case 54:
ACCEPT_TOKEN(anon_sym_PLUS);
END_STATE();
case 55: case 55:
ACCEPT_TOKEN(anon_sym_PLUS); ACCEPT_TOKEN(anon_sym_PLUS);
if (lookahead == '=') ADVANCE(71);
END_STATE(); END_STATE();
case 56: case 56:
ACCEPT_TOKEN(anon_sym_PLUS); ACCEPT_TOKEN(anon_sym_DASH);
if (lookahead == '=') ADVANCE(72); if (lookahead == '=') ADVANCE(72);
if (lookahead == '>') ADVANCE(76);
END_STATE(); END_STATE();
case 57: case 57:
ACCEPT_TOKEN(anon_sym_DASH); ACCEPT_TOKEN(anon_sym_DASH);
if (lookahead == '=') ADVANCE(73); if (lookahead == '>') ADVANCE(76);
if (lookahead == '>') ADVANCE(77);
END_STATE(); END_STATE();
case 58: case 58:
ACCEPT_TOKEN(anon_sym_DASH); ACCEPT_TOKEN(anon_sym_DASH);
if (lookahead == '>') ADVANCE(77); if (('0' <= lookahead && lookahead <= '9')) ADVANCE(45);
if (lookahead == '=') ADVANCE(72);
if (lookahead == '>') ADVANCE(76);
END_STATE(); END_STATE();
case 59: case 59:
ACCEPT_TOKEN(anon_sym_DASH);
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(46);
if (lookahead == '=') ADVANCE(73);
if (lookahead == '>') ADVANCE(77);
END_STATE();
case 60:
ACCEPT_TOKEN(anon_sym_STAR); ACCEPT_TOKEN(anon_sym_STAR);
END_STATE(); END_STATE();
case 61: case 60:
ACCEPT_TOKEN(anon_sym_SLASH); ACCEPT_TOKEN(anon_sym_SLASH);
END_STATE(); END_STATE();
case 62: case 61:
ACCEPT_TOKEN(anon_sym_PERCENT); ACCEPT_TOKEN(anon_sym_PERCENT);
END_STATE(); END_STATE();
case 63: case 62:
ACCEPT_TOKEN(anon_sym_EQ_EQ); ACCEPT_TOKEN(anon_sym_EQ_EQ);
END_STATE(); END_STATE();
case 64: case 63:
ACCEPT_TOKEN(anon_sym_BANG_EQ); ACCEPT_TOKEN(anon_sym_BANG_EQ);
END_STATE(); END_STATE();
case 65: case 64:
ACCEPT_TOKEN(anon_sym_AMP_AMP); ACCEPT_TOKEN(anon_sym_AMP_AMP);
END_STATE(); END_STATE();
case 66: case 65:
ACCEPT_TOKEN(anon_sym_PIPE_PIPE); ACCEPT_TOKEN(anon_sym_PIPE_PIPE);
END_STATE(); END_STATE();
case 66:
ACCEPT_TOKEN(anon_sym_GT);
END_STATE();
case 67: case 67:
ACCEPT_TOKEN(anon_sym_GT); ACCEPT_TOKEN(anon_sym_GT);
if (lookahead == '=') ADVANCE(69);
END_STATE(); END_STATE();
case 68: case 68:
ACCEPT_TOKEN(anon_sym_GT); ACCEPT_TOKEN(anon_sym_LT);
if (lookahead == '=') ADVANCE(70); if (lookahead == '=') ADVANCE(70);
END_STATE(); END_STATE();
case 69: case 69:
ACCEPT_TOKEN(anon_sym_LT);
if (lookahead == '=') ADVANCE(71);
END_STATE();
case 70:
ACCEPT_TOKEN(anon_sym_GT_EQ); ACCEPT_TOKEN(anon_sym_GT_EQ);
END_STATE(); END_STATE();
case 71: case 70:
ACCEPT_TOKEN(anon_sym_LT_EQ); ACCEPT_TOKEN(anon_sym_LT_EQ);
END_STATE(); END_STATE();
case 72: case 71:
ACCEPT_TOKEN(anon_sym_PLUS_EQ); ACCEPT_TOKEN(anon_sym_PLUS_EQ);
END_STATE(); END_STATE();
case 73: case 72:
ACCEPT_TOKEN(anon_sym_DASH_EQ); ACCEPT_TOKEN(anon_sym_DASH_EQ);
END_STATE(); END_STATE();
case 74: case 73:
ACCEPT_TOKEN(anon_sym_elseif); ACCEPT_TOKEN(anon_sym_elseif);
END_STATE(); END_STATE();
case 75: case 74:
ACCEPT_TOKEN(anon_sym_EQ_GT); ACCEPT_TOKEN(anon_sym_EQ_GT);
END_STATE(); END_STATE();
case 76: case 75:
ACCEPT_TOKEN(anon_sym_asyncfor); ACCEPT_TOKEN(anon_sym_asyncfor);
END_STATE(); END_STATE();
case 77: case 76:
ACCEPT_TOKEN(anon_sym_DASH_GT); ACCEPT_TOKEN(anon_sym_DASH_GT);
END_STATE(); END_STATE();
default: default: