Tweak comment parsing
This is taken verbatim from tree-sitter-c [1], just in case :-). [1]: https://github.com/tree-sitter/tree-sitter-c
This commit is contained in:
parent
b62fc19da9
commit
adec624d74
|
@ -23,8 +23,8 @@ module.exports = grammar({
|
||||||
),
|
),
|
||||||
|
|
||||||
comment: (_) => choice(
|
comment: (_) => choice(
|
||||||
seq("//", /[^\n]*/),
|
seq("//", /(\\+(.|\r?\n)|[^\\\n])*/),
|
||||||
seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, '/'),
|
seq("/*", /[^*]*\*+([^/*][^*]*\*+)*/, "/"),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Definitions {{{
|
// Definitions {{{
|
||||||
|
|
2
src/grammar.json
generated
2
src/grammar.json
generated
|
@ -33,7 +33,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "PATTERN",
|
"type": "PATTERN",
|
||||||
"value": "[^\\n]*"
|
"value": "(\\\\+(.|\\r?\\n)|[^\\\\\\n])*"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
924
src/parser.c
generated
924
src/parser.c
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue