Allow more characters in char_lit

pull/70/head
Stephan Seitz 2021-11-28 11:44:03 +07:00
parent 4acbcb0138
commit 3487072dda
4 changed files with 26 additions and 26 deletions

@ -275,7 +275,7 @@ module.exports = grammar(clojure, {
array_dimension: _ => prec(100, /\d+[aA]/),
char_lit: _ =>
seq('#', /\\[^:\f\n\r\t ()\[\]{}"^;`\\,#'\u000B\u001C\u001D\u001E\u001F\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2008\u2009\u200a\u205f\u3000]+/),
seq('#', /\\[^\f\n\r\t ()]+/),
vec_lit: $ =>
prec(PREC.SPECIAL,

@ -621,7 +621,7 @@
},
{
"type": "PATTERN",
"value": "\\\\[^:\\f\\n\\r\\t ()\\[\\]{}\"^;`\\\\,#'\\u000B\\u001C\\u001D\\u001E\\u001F\\u2028\\u2029\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2008\\u2009\\u200a\\u205f\\u3000]+"
"value": "\\\\[^\\f\\n\\r\\t ()]+"
}
]
},

@ -2287,28 +2287,6 @@ static inline bool aux_sym_str_lit_token1_character_set_1(int32_t c) {
: (c <= 't' || c == 'x'))));
}
static inline bool aux_sym_char_lit_token1_character_set_1(int32_t c) {
return (c < '`'
? (c < '\''
? (c < 28
? (c < '\t'
? c == 0
: c <= '\r')
: (c <= ' ' || (c >= '"' && c <= '#')))
: (c <= ')' || (c < ':'
? c == ','
: (c <= ';' || (c >= '[' && c <= '^')))))
: (c <= '`' || (c < 8200
? (c < 5760
? (c < '}'
? c == '{'
: c <= '}')
: (c <= 5760 || (c >= 8192 && c <= 8198)))
: (c <= 8202 || (c < 8287
? (c >= 8232 && c <= 8233)
: (c <= 8287 || c == 12288))))));
}
static inline bool aux_sym_sym_lit_token1_character_set_1(int32_t c) {
return (c < '}'
? (c < ')'
@ -4337,7 +4315,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
('a' <= lookahead && lookahead <= 'z')) ADVANCE(268);
END_STATE();
case 242:
if (!aux_sym_char_lit_token1_character_set_1(lookahead)) ADVANCE(304);
if (lookahead != 0 &&
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\f' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '(' &&
lookahead != ')') ADVANCE(304);
END_STATE();
case 243:
if (lookahead != 0 &&
@ -4811,7 +4796,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
END_STATE();
case 304:
ACCEPT_TOKEN(aux_sym_char_lit_token1);
if (!aux_sym_char_lit_token1_character_set_1(lookahead)) ADVANCE(304);
if (lookahead != 0 &&
lookahead != '\t' &&
lookahead != '\n' &&
lookahead != '\f' &&
lookahead != '\r' &&
lookahead != ' ' &&
lookahead != '(' &&
lookahead != ')') ADVANCE(304);
END_STATE();
case 305:
ACCEPT_TOKEN(sym_nil_lit);

@ -612,9 +612,17 @@ Chars
================================================================================
#\?
#\,
#\-
#\:
#\/
--------------------------------------------------------------------------------
(source
(char_lit)
(char_lit)
(char_lit)
(char_lit)
(char_lit))
================================================================================