type: preliminarily forbit \; in types
This commit is contained in:
parent
831aefb112
commit
41c4428c89
4 changed files with 5 additions and 3 deletions
|
@ -21,7 +21,7 @@ module.exports = grammar({
|
|||
typedef: ($) => prec.right(seq("type", $.ident, "=", $.type, ";")),
|
||||
morphdef: ($) => prec.right(seq("morph", $.ident, ":", $.type, "=", $.impl, ";")),
|
||||
ident: ($) => /([a-zA-Z$][0-9a-zA-Z_\-]*)/,
|
||||
type: ($) => /([^\`\=]*)/,
|
||||
type: ($) => /([^\`\=\;]*)/,
|
||||
impl: ($) => seq("```", $.impl_c_code, "```"),
|
||||
impl_c_code: (_) => /([^\`]*)/,
|
||||
},
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
((impl_c_code @injection.content)
|
||||
((impl_c_code) @injection.content
|
||||
(#set! injection.language "c"))
|
||||
|
||||
|
|
2
src/grammar.json
generated
2
src/grammar.json
generated
|
@ -158,7 +158,7 @@
|
|||
},
|
||||
"type": {
|
||||
"type": "PATTERN",
|
||||
"value": "([^\\`\\=]*)"
|
||||
"value": "([^\\`\\=\\;]*)"
|
||||
},
|
||||
"impl": {
|
||||
"type": "SEQ",
|
||||
|
|
2
src/parser.c
generated
2
src/parser.c
generated
|
@ -363,12 +363,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
|
|||
if (('\t' <= lookahead && lookahead <= '\r') ||
|
||||
lookahead == ' ') ADVANCE(27);
|
||||
if (lookahead != 0 &&
|
||||
lookahead != ';' &&
|
||||
lookahead != '=' &&
|
||||
lookahead != '`') ADVANCE(28);
|
||||
END_STATE();
|
||||
case 28:
|
||||
ACCEPT_TOKEN(sym_type);
|
||||
if (lookahead != 0 &&
|
||||
lookahead != ';' &&
|
||||
lookahead != '=' &&
|
||||
lookahead != '`') ADVANCE(28);
|
||||
END_STATE();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue