summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-07-24 05:05:28 -0400
committerAmaan Qureshi <amaanq12@gmail.com>2023-07-24 05:05:28 -0400
commit5890e77d2db4533abd5d1b8fe7657a7fd64d9972 (patch)
tree4c2bd7c02798c4532d76a38707951c95d1968754
parentf3559c6cb4012f6fb487c95941fc9eb27922d686 (diff)
fix: disallow `/` after `\S` to better handle comments in preproc_arg
-rw-r--r--grammar.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/grammar.js b/grammar.js
index d8a9761f1..9ac301bc1 100644
--- a/grammar.js
+++ b/grammar.js
@@ -148,7 +148,7 @@ module.exports = grammar({
...preprocIf('', $ => $._block_item),
...preprocIf('_in_field_declaration_list', $ => $._field_declaration_list_item),
- preproc_arg: _ => token(prec(-1, /\S(.|\\\r?\n)*/)),
+ preproc_arg: _ => token(prec(-1, /\S([^/\n]|\\\r?\n)*/)),
preproc_directive: _ => /#[ \t]*[a-zA-Z0-9]\w*/,
_preproc_expression: $ => choice(