mirror of
https://github.com/JellyApple102/tree-sitter-dfraw.git
synced 2024-11-22 14:09:20 +02:00
update string punctuation
This commit is contained in:
parent
dc3c610e5f
commit
07f6a311b2
|
@ -36,7 +36,7 @@ module.exports = grammar({
|
||||||
|
|
||||||
large: $ => /[A-Z_\d]+/,
|
large: $ => /[A-Z_\d]+/,
|
||||||
|
|
||||||
string: $ => /[A-Za-z \-,.']+/,
|
string: $ => /[A-Za-z \-,.'/\\]+/,
|
||||||
|
|
||||||
separator: $ => /:/,
|
separator: $ => /:/,
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
},
|
},
|
||||||
"string": {
|
"string": {
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "[A-Za-z \\-,.']+"
|
"value": "[A-Za-z \\-,.'/\\\\]+"
|
||||||
},
|
},
|
||||||
"separator": {
|
"separator": {
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
|
|
12
src/parser.c
12
src/parser.c
|
@ -182,7 +182,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
||||||
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9);
|
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9);
|
||||||
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
||||||
if (lookahead == '\'' ||
|
if (lookahead == '\'' ||
|
||||||
(',' <= lookahead && lookahead <= '.') ||
|
(',' <= lookahead && lookahead <= '/') ||
|
||||||
|
lookahead == '\\' ||
|
||||||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -220,7 +221,8 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
||||||
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
||||||
if (lookahead == ' ' ||
|
if (lookahead == ' ' ||
|
||||||
lookahead == '\'' ||
|
lookahead == '\'' ||
|
||||||
(',' <= lookahead && lookahead <= '.') ||
|
(',' <= lookahead && lookahead <= '/') ||
|
||||||
|
lookahead == '\\' ||
|
||||||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 8:
|
case 8:
|
||||||
|
@ -239,15 +241,17 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
||||||
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9);
|
if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9);
|
||||||
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
if (('A' <= lookahead && lookahead <= 'Z')) ADVANCE(7);
|
||||||
if (lookahead == '\'' ||
|
if (lookahead == '\'' ||
|
||||||
(',' <= lookahead && lookahead <= '.') ||
|
(',' <= lookahead && lookahead <= '/') ||
|
||||||
|
lookahead == '\\' ||
|
||||||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 11:
|
case 11:
|
||||||
ACCEPT_TOKEN(sym_string);
|
ACCEPT_TOKEN(sym_string);
|
||||||
if (lookahead == ' ' ||
|
if (lookahead == ' ' ||
|
||||||
lookahead == '\'' ||
|
lookahead == '\'' ||
|
||||||
(',' <= lookahead && lookahead <= '.') ||
|
(',' <= lookahead && lookahead <= '/') ||
|
||||||
('A' <= lookahead && lookahead <= 'Z') ||
|
('A' <= lookahead && lookahead <= 'Z') ||
|
||||||
|
lookahead == '\\' ||
|
||||||
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
('a' <= lookahead && lookahead <= 'z')) ADVANCE(11);
|
||||||
END_STATE();
|
END_STATE();
|
||||||
case 12:
|
case 12:
|
||||||
|
|
Loading…
Reference in New Issue