diff --git a/tree_sitter_v/grammar.cjs b/tree_sitter_v/grammar.cjs index 6649e683..efe65f51 100644 --- a/tree_sitter_v/grammar.cjs +++ b/tree_sitter_v/grammar.cjs @@ -1056,12 +1056,12 @@ module.exports = grammar({ choice( seq( $.__r_single_quote, - repeat(token.immediate(prec.right(1, /[^'\\]+/))), + repeat(token.immediate(prec.right(1, /[^']+/))), $.__single_quote, ), seq( $.__r_double_quote, - repeat(token.immediate(prec.right(1, /[^"\\]+/))), + repeat(token.immediate(prec.right(1, /[^"]+/))), $.__double_quote, ), ), diff --git a/tree_sitter_v/src/grammar.json b/tree_sitter_v/src/grammar.json index 8ec866f2..9cd1b06b 100644 --- a/tree_sitter_v/src/grammar.json +++ b/tree_sitter_v/src/grammar.json @@ -6146,7 +6146,7 @@ "value": 1, "content": { "type": "PATTERN", - "value": "[^'\\\\]+" + "value": "[^']+" } } } @@ -6173,7 +6173,7 @@ "value": 1, "content": { "type": "PATTERN", - "value": "[^\"\\\\]+" + "value": "[^\"]+" } } } diff --git a/tree_sitter_v/src/parser.c b/tree_sitter_v/src/parser.c index 7c6e4eb8..7bbe80e2 100644 --- a/tree_sitter_v/src/parser.c +++ b/tree_sitter_v/src/parser.c @@ -11281,8 +11281,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '/') ADVANCE(621); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(674); - if (lookahead != 0 && - lookahead != '\\') ADVANCE(679); + if (lookahead != 0) ADVANCE(679); END_STATE(); case 90: if (lookahead == '$') ADVANCE(181); @@ -11367,8 +11366,7 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '/') ADVANCE(552); if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(605); - if (lookahead != 0 && - lookahead != '\\') ADVANCE(610); + if (lookahead != 0) ADVANCE(610); END_STATE(); case 97: if (lookahead == '*') ADVANCE(99); @@ -14642,499 +14640,436 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '*') ADVANCE(610); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(542); + lookahead != '\'') ADVANCE(542); END_STATE(); case 543: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead == '/') ADVANCE(579); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(576); + lookahead != '\'') ADVANCE(576); END_STATE(); case 544: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead == '/') ADVANCE(542); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(542); + lookahead != '\'') ADVANCE(542); END_STATE(); case 545: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead == '/') ADVANCE(580); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(555); + lookahead != '\'') ADVANCE(555); END_STATE(); case 546: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(608); + lookahead != '\'') ADVANCE(608); END_STATE(); case 547: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(554); + lookahead != '\'') ADVANCE(554); END_STATE(); case 548: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(542); + lookahead != '\'') ADVANCE(542); END_STATE(); case 549: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(606); if (lookahead == '/') ADVANCE(558); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(549); + lookahead != '\'') ADVANCE(549); END_STATE(); case 550: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(606); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(550); + lookahead != '\'') ADVANCE(550); END_STATE(); case 551: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(606); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(549); + lookahead != '\'') ADVANCE(549); END_STATE(); case 552: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(553); if (lookahead == '/') ADVANCE(609); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(610); + lookahead != '\'') ADVANCE(610); END_STATE(); case 553: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(544); if (lookahead == '/') ADVANCE(550); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(551); + lookahead != '\'') ADVANCE(551); END_STATE(); case 554: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(548); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(564); + lookahead != '\'') ADVANCE(564); END_STATE(); case 555: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(548); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(563); + lookahead != '\'') ADVANCE(563); END_STATE(); case 556: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(548); if (lookahead == '/') ADVANCE(590); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(591); + lookahead != '\'') ADVANCE(591); END_STATE(); case 557: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(559); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(542); + lookahead != '\'') ADVANCE(542); END_STATE(); case 558: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(559); if (lookahead == '/') ADVANCE(558); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(549); + lookahead != '\'') ADVANCE(549); END_STATE(); case 559: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(560); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(547); + lookahead != '\'') ADVANCE(547); END_STATE(); case 560: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(560); if (lookahead == '/') ADVANCE(554); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(554); + lookahead != '\'') ADVANCE(554); END_STATE(); case 561: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(560); if (lookahead == '/') ADVANCE(542); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(545); + lookahead != '\'') ADVANCE(545); END_STATE(); case 562: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(569); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(604); + lookahead != '\'') ADVANCE(604); END_STATE(); case 563: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(569); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 564: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(569); if (lookahead == '/') ADVANCE(563); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 565: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(565); + lookahead != '\'') ADVANCE(565); END_STATE(); case 566: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(566); + lookahead != '\'') ADVANCE(566); END_STATE(); case 567: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(546); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(565); + lookahead != '\'') ADVANCE(565); END_STATE(); case 568: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(554); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(602); + lookahead != '\'') ADVANCE(602); END_STATE(); case 569: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(542); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(566); + lookahead != '\'') ADVANCE(566); END_STATE(); case 570: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(543); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(566); + lookahead != '\'') ADVANCE(566); END_STATE(); case 571: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(567); if (lookahead == '/') ADVANCE(580); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 572: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(565); if (lookahead == '/') ADVANCE(608); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(592); + lookahead != '\'') ADVANCE(592); END_STATE(); case 573: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(565); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(566); + lookahead != '\'') ADVANCE(566); END_STATE(); case 574: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(565); if (lookahead == '/') ADVANCE(579); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(593); + lookahead != '\'') ADVANCE(593); END_STATE(); case 575: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(586); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 576: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(578); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(577); + lookahead != '\'') ADVANCE(577); END_STATE(); case 577: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(578); if (lookahead == '/') ADVANCE(584); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(581); + lookahead != '\'') ADVANCE(581); END_STATE(); case 578: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(578); if (lookahead == '/') ADVANCE(607); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(582); + lookahead != '\'') ADVANCE(582); END_STATE(); case 579: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(588); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(577); + lookahead != '\'') ADVANCE(577); END_STATE(); case 580: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(561); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(563); + lookahead != '\'') ADVANCE(563); END_STATE(); case 581: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(597); if (lookahead == '/') ADVANCE(584); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(594); + lookahead != '\'') ADVANCE(594); END_STATE(); case 582: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(597); if (lookahead == '/') ADVANCE(607); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(597); + lookahead != '\'') ADVANCE(597); END_STATE(); case 583: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(597); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(599); + lookahead != '\'') ADVANCE(599); END_STATE(); case 584: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(585); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(566); + lookahead != '\'') ADVANCE(566); END_STATE(); case 585: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(587); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(568); + lookahead != '\'') ADVANCE(568); END_STATE(); case 586: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(587); if (lookahead == '/') ADVANCE(542); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(571); + lookahead != '\'') ADVANCE(571); END_STATE(); case 587: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(587); if (lookahead == '/') ADVANCE(556); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(602); + lookahead != '\'') ADVANCE(602); END_STATE(); case 588: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(589); if (lookahead == '/') ADVANCE(607); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(583); + lookahead != '\'') ADVANCE(583); END_STATE(); case 589: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(589); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(590); + lookahead != '\'') ADVANCE(590); END_STATE(); case 590: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(595); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(601); + lookahead != '\'') ADVANCE(601); END_STATE(); case 591: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(595); if (lookahead == '/') ADVANCE(563); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(600); + lookahead != '\'') ADVANCE(600); END_STATE(); case 592: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(597); + lookahead != '\'') ADVANCE(597); END_STATE(); case 593: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(557); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(594); + lookahead != '\'') ADVANCE(594); END_STATE(); case 594: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(584); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(594); + lookahead != '\'') ADVANCE(594); END_STATE(); case 595: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(573); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(594); + lookahead != '\'') ADVANCE(594); END_STATE(); case 596: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(572); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(597); + lookahead != '\'') ADVANCE(597); END_STATE(); case 597: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(607); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(597); + lookahead != '\'') ADVANCE(597); END_STATE(); case 598: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(596); if (lookahead == '/') ADVANCE(574); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(594); + lookahead != '\'') ADVANCE(594); END_STATE(); case 599: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(598); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(601); + lookahead != '\'') ADVANCE(601); END_STATE(); case 600: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(598); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(600); + lookahead != '\'') ADVANCE(600); END_STATE(); case 601: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(598); if (lookahead == '/') ADVANCE(563); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(600); + lookahead != '\'') ADVANCE(600); END_STATE(); case 602: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(570); if (lookahead == '/') ADVANCE(562); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(604); + lookahead != '\'') ADVANCE(604); END_STATE(); case 603: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(570); if (lookahead == '/') ADVANCE(575); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 604: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '*') ADVANCE(570); if (lookahead == '/') ADVANCE(563); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(603); + lookahead != '\'') ADVANCE(603); END_STATE(); case 605: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); @@ -15142,542 +15077,473 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(605); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(610); + lookahead != '\'') ADVANCE(610); END_STATE(); case 606: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(610); + lookahead != '\'') ADVANCE(610); END_STATE(); case 607: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(565); + lookahead != '\'') ADVANCE(565); END_STATE(); case 608: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '/') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(578); + lookahead != '\'') ADVANCE(578); END_STATE(); case 609: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead == '\n' || lookahead == '\r') ADVANCE(610); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(609); + lookahead != '\'') ADVANCE(609); END_STATE(); case 610: ACCEPT_TOKEN(aux_sym_raw_string_literal_token1); if (lookahead != 0 && - lookahead != '\'' && - lookahead != '\\') ADVANCE(610); + lookahead != '\'') ADVANCE(610); END_STATE(); case 611: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(611); + lookahead != '"') ADVANCE(611); END_STATE(); case 612: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead == '/') ADVANCE(648); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(645); + lookahead != '"') ADVANCE(645); END_STATE(); case 613: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead == '/') ADVANCE(611); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(611); + lookahead != '"') ADVANCE(611); END_STATE(); case 614: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead == '/') ADVANCE(649); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(624); + lookahead != '"') ADVANCE(624); END_STATE(); case 615: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(677); + lookahead != '"') ADVANCE(677); END_STATE(); case 616: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(623); + lookahead != '"') ADVANCE(623); END_STATE(); case 617: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(611); + lookahead != '"') ADVANCE(611); END_STATE(); case 618: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(675); if (lookahead == '/') ADVANCE(627); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(618); + lookahead != '"') ADVANCE(618); END_STATE(); case 619: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(675); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(619); + lookahead != '"') ADVANCE(619); END_STATE(); case 620: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(675); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(618); + lookahead != '"') ADVANCE(618); END_STATE(); case 621: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(622); if (lookahead == '/') ADVANCE(678); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(679); + lookahead != '"') ADVANCE(679); END_STATE(); case 622: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(613); if (lookahead == '/') ADVANCE(619); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(620); + lookahead != '"') ADVANCE(620); END_STATE(); case 623: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(617); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(633); + lookahead != '"') ADVANCE(633); END_STATE(); case 624: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(617); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(632); + lookahead != '"') ADVANCE(632); END_STATE(); case 625: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(617); if (lookahead == '/') ADVANCE(659); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(660); + lookahead != '"') ADVANCE(660); END_STATE(); case 626: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(628); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(611); + lookahead != '"') ADVANCE(611); END_STATE(); case 627: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(628); if (lookahead == '/') ADVANCE(627); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(618); + lookahead != '"') ADVANCE(618); END_STATE(); case 628: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(629); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(616); + lookahead != '"') ADVANCE(616); END_STATE(); case 629: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(629); if (lookahead == '/') ADVANCE(623); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(623); + lookahead != '"') ADVANCE(623); END_STATE(); case 630: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(629); if (lookahead == '/') ADVANCE(611); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(614); + lookahead != '"') ADVANCE(614); END_STATE(); case 631: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(638); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(673); + lookahead != '"') ADVANCE(673); END_STATE(); case 632: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(638); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 633: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(638); if (lookahead == '/') ADVANCE(632); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 634: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(634); + lookahead != '"') ADVANCE(634); END_STATE(); case 635: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(635); + lookahead != '"') ADVANCE(635); END_STATE(); case 636: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(615); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(634); + lookahead != '"') ADVANCE(634); END_STATE(); case 637: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(623); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(671); + lookahead != '"') ADVANCE(671); END_STATE(); case 638: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(611); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(635); + lookahead != '"') ADVANCE(635); END_STATE(); case 639: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(612); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(635); + lookahead != '"') ADVANCE(635); END_STATE(); case 640: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(636); if (lookahead == '/') ADVANCE(649); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 641: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(634); if (lookahead == '/') ADVANCE(677); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(661); + lookahead != '"') ADVANCE(661); END_STATE(); case 642: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(634); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(635); + lookahead != '"') ADVANCE(635); END_STATE(); case 643: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(634); if (lookahead == '/') ADVANCE(648); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(662); + lookahead != '"') ADVANCE(662); END_STATE(); case 644: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(655); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 645: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(647); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(646); + lookahead != '"') ADVANCE(646); END_STATE(); case 646: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(647); if (lookahead == '/') ADVANCE(653); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(650); + lookahead != '"') ADVANCE(650); END_STATE(); case 647: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(647); if (lookahead == '/') ADVANCE(676); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(651); + lookahead != '"') ADVANCE(651); END_STATE(); case 648: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(657); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(646); + lookahead != '"') ADVANCE(646); END_STATE(); case 649: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(630); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(632); + lookahead != '"') ADVANCE(632); END_STATE(); case 650: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(666); if (lookahead == '/') ADVANCE(653); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(663); + lookahead != '"') ADVANCE(663); END_STATE(); case 651: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(666); if (lookahead == '/') ADVANCE(676); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(666); + lookahead != '"') ADVANCE(666); END_STATE(); case 652: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(666); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(668); + lookahead != '"') ADVANCE(668); END_STATE(); case 653: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(654); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(635); + lookahead != '"') ADVANCE(635); END_STATE(); case 654: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(656); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(637); + lookahead != '"') ADVANCE(637); END_STATE(); case 655: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(656); if (lookahead == '/') ADVANCE(611); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(640); + lookahead != '"') ADVANCE(640); END_STATE(); case 656: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(656); if (lookahead == '/') ADVANCE(625); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(671); + lookahead != '"') ADVANCE(671); END_STATE(); case 657: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(658); if (lookahead == '/') ADVANCE(676); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(652); + lookahead != '"') ADVANCE(652); END_STATE(); case 658: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(658); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(659); + lookahead != '"') ADVANCE(659); END_STATE(); case 659: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(664); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(670); + lookahead != '"') ADVANCE(670); END_STATE(); case 660: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(664); if (lookahead == '/') ADVANCE(632); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(669); + lookahead != '"') ADVANCE(669); END_STATE(); case 661: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(666); + lookahead != '"') ADVANCE(666); END_STATE(); case 662: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(626); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(663); + lookahead != '"') ADVANCE(663); END_STATE(); case 663: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(653); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(663); + lookahead != '"') ADVANCE(663); END_STATE(); case 664: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(642); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(663); + lookahead != '"') ADVANCE(663); END_STATE(); case 665: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(641); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(666); + lookahead != '"') ADVANCE(666); END_STATE(); case 666: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(676); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(666); + lookahead != '"') ADVANCE(666); END_STATE(); case 667: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(665); if (lookahead == '/') ADVANCE(643); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(663); + lookahead != '"') ADVANCE(663); END_STATE(); case 668: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(667); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(670); + lookahead != '"') ADVANCE(670); END_STATE(); case 669: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(667); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(669); + lookahead != '"') ADVANCE(669); END_STATE(); case 670: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(667); if (lookahead == '/') ADVANCE(632); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(669); + lookahead != '"') ADVANCE(669); END_STATE(); case 671: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(639); if (lookahead == '/') ADVANCE(631); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(673); + lookahead != '"') ADVANCE(673); END_STATE(); case 672: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(639); if (lookahead == '/') ADVANCE(644); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 673: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '*') ADVANCE(639); if (lookahead == '/') ADVANCE(632); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(672); + lookahead != '"') ADVANCE(672); END_STATE(); case 674: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); @@ -15685,43 +15551,37 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (('\t' <= lookahead && lookahead <= '\r') || lookahead == ' ') ADVANCE(674); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(679); + lookahead != '"') ADVANCE(679); END_STATE(); case 675: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(679); + lookahead != '"') ADVANCE(679); END_STATE(); case 676: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(634); + lookahead != '"') ADVANCE(634); END_STATE(); case 677: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '/') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(647); + lookahead != '"') ADVANCE(647); END_STATE(); case 678: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead == '\n' || lookahead == '\r') ADVANCE(679); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(678); + lookahead != '"') ADVANCE(678); END_STATE(); case 679: ACCEPT_TOKEN(aux_sym_raw_string_literal_token2); if (lookahead != 0 && - lookahead != '"' && - lookahead != '\\') ADVANCE(679); + lookahead != '"') ADVANCE(679); END_STATE(); case 680: ACCEPT_TOKEN(aux_sym_format_specifier_token2); diff --git a/tree_sitter_v/test/corpus/string_literal.txt b/tree_sitter_v/test/corpus/string_literal.txt index ff561744..67c462a3 100644 --- a/tree_sitter_v/test/corpus/string_literal.txt +++ b/tree_sitter_v/test/corpus/string_literal.txt @@ -425,3 +425,18 @@ String literal with interpolation after \n (reference_expression (identifier)))) (interpolation_closing)))))) + +================================================================================ +Raw String literal with \ +================================================================================ +r'\' +r"\" +-------------------------------------------------------------------------------- + +(source_file + (simple_statement + (literal + (raw_string_literal))) + (simple_statement + (literal + (raw_string_literal))))