diff --git a/grammar.js b/grammar.js index 1ca9260..c7838d4 100644 --- a/grammar.js +++ b/grammar.js @@ -11,7 +11,7 @@ const PREC = { }; // Identifiers cannot start with `.` -const IDENTIFIER = /[a-zA-Z0-9\-_\$][a-zA-Z0-9.\-_\$]*/; +const IDENTIFIER = /[a-zA-Z0-9\-_][a-zA-Z0-9.\-_]*/; module.exports = grammar({ name: "query", diff --git a/src/grammar.json b/src/grammar.json index 5846352..2ed14ac 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -141,7 +141,7 @@ }, "identifier": { "type": "PATTERN", - "value": "[a-zA-Z0-9\\-_\\$][a-zA-Z0-9.\\-_\\$]*" + "value": "[a-zA-Z0-9\\-_][a-zA-Z0-9.\\-_]*" }, "_immediate_identifier": { "type": "ALIAS", @@ -149,7 +149,7 @@ "type": "IMMEDIATE_TOKEN", "content": { "type": "PATTERN", - "value": "[a-zA-Z0-9\\-_\\$][a-zA-Z0-9.\\-_\\$]*" + "value": "[a-zA-Z0-9\\-_][a-zA-Z0-9.\\-_]*" } }, "named": true, diff --git a/src/parser.c b/src/parser.c index bb2803e..c0bc3c6 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,4 +1,4 @@ -/* Automatically @generated by tree-sitter v0.25.5 (460118b4c82318b083b4d527c9c750426730f9c0) */ +/* Automatically @generated by tree-sitter v0.25.6 */ #include "tree_sitter/parser.h" @@ -754,8 +754,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(8); - if (lookahead == '$' || - ('-' <= lookahead && lookahead <= '9') || + if (('-' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); END_STATE(); @@ -773,8 +772,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == ';') ADVANCE(31); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(6); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || @@ -795,8 +793,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(4); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); @@ -814,8 +811,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(4); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); @@ -826,8 +822,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == ';') ADVANCE(31); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(5); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || @@ -864,8 +859,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(8); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); @@ -891,8 +885,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(10); - if (lookahead == '$' || - ('-' <= lookahead && lookahead <= '9') || + if (('-' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); END_STATE(); @@ -916,8 +909,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') SKIP(10); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || ('a' <= lookahead && lookahead <= 'z')) ADVANCE(23); @@ -943,8 +935,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 17: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'G') ADVANCE(36); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -954,8 +945,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 18: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'I') ADVANCE(22); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -965,8 +955,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 19: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'I') ADVANCE(20); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -976,8 +965,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 20: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'N') ADVANCE(17); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -987,8 +975,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 21: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'S') ADVANCE(19); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -998,8 +985,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { case 22: ACCEPT_TOKEN(sym_identifier); if (lookahead == 'S') ADVANCE(21); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -1008,8 +994,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { END_STATE(); case 23: ACCEPT_TOKEN(sym_identifier); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -1018,8 +1003,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { END_STATE(); case 24: ACCEPT_TOKEN(aux_sym__immediate_identifier_token1); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -1028,8 +1012,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { END_STATE(); case 25: ACCEPT_TOKEN(anon_sym__); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || @@ -1082,8 +1065,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { END_STATE(); case 36: ACCEPT_TOKEN(anon_sym_MISSING); - if (lookahead == '$' || - lookahead == '-' || + if (lookahead == '-' || lookahead == '.' || ('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') ||