diff options
author | Amaan Qureshi <amaanq12@gmail.com> | 2023-07-24 05:15:32 -0400 |
---|---|---|
committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-07-24 05:23:19 -0400 |
commit | 41c0a15e09a4388ff2dbb77153d6ba2d0f629ebc (patch) | |
tree | df1d08dadecb5ad09a249d0278d5780d61683170 | |
parent | 5890e77d2db4533abd5d1b8fe7657a7fd64d9972 (diff) |
fix: make preproc newlines immediate so they don't span excess trailing newliens
-rw-r--r-- | grammar.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/grammar.js b/grammar.js index 9ac301bc1..e00f7848c 100644 --- a/grammar.js +++ b/grammar.js @@ -117,14 +117,14 @@ module.exports = grammar({ $.identifier, alias($.preproc_call_expression, $.call_expression), )), - '\n', + token.immediate(/\r?\n/), ), preproc_def: $ => seq( preprocessor('define'), field('name', $.identifier), field('value', optional($.preproc_arg)), - '\n', + token.immediate(/\r?\n/), ), preproc_function_def: $ => seq( @@ -132,7 +132,7 @@ module.exports = grammar({ field('name', $.identifier), field('parameters', $.preproc_params), field('value', optional($.preproc_arg)), - '\n', + token.immediate(/\r?\n/), ), preproc_params: $ => seq( @@ -142,7 +142,7 @@ module.exports = grammar({ preproc_call: $ => seq( field('directive', $.preproc_directive), field('argument', optional($.preproc_arg)), - '\n', + token.immediate(/\r?\n/), ), ...preprocIf('', $ => $._block_item), |