|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?I=C3=B1aki=20Amatria=20Barral?= <inaki.amatria@appentra.com> |
| 3 | +Date: Mon, 27 Oct 2025 15:27:51 +0100 |
| 4 | +Subject: Use `_external_end_of_statement` |
| 5 | + |
| 6 | +--- |
| 7 | + grammar.js | 8 ++++---- |
| 8 | + 1 file changed, 4 insertions(+), 4 deletions(-) |
| 9 | + |
| 10 | +diff --git a/grammar.js b/grammar.js |
| 11 | +index f1c074f..a19a824 100644 |
| 12 | +--- a/grammar.js |
| 13 | ++++ b/grammar.js |
| 14 | +@@ -153,14 +153,14 @@ module.exports = grammar({ |
| 15 | + $.system_lib_string, |
| 16 | + alias($.preproc_call_expression, $.call_expression), |
| 17 | + )), |
| 18 | +- /\r?\n/, |
| 19 | ++ $._external_end_of_statement, |
| 20 | + ), |
| 21 | + |
| 22 | + preproc_def: $ => seq( |
| 23 | + preprocessor('define'), |
| 24 | + field('name', $.identifier), |
| 25 | + field('value', optional($.preproc_arg)), |
| 26 | +- token(prec(1, /\r?\n/)), // force newline to win over preproc_arg |
| 27 | ++ $._external_end_of_statement, |
| 28 | + ), |
| 29 | + |
| 30 | + preproc_function_def: $ => seq( |
| 31 | +@@ -168,7 +168,7 @@ module.exports = grammar({ |
| 32 | + field('name', $.identifier), |
| 33 | + field('parameters', $.preproc_params), |
| 34 | + field('value', optional($.preproc_arg)), |
| 35 | +- token.immediate(/\r?\n/), |
| 36 | ++ $._external_end_of_statement, |
| 37 | + ), |
| 38 | + |
| 39 | + preproc_params: $ => seq( |
| 40 | +@@ -178,7 +178,7 @@ module.exports = grammar({ |
| 41 | + preproc_call: $ => seq( |
| 42 | + field('directive', $.preproc_directive), |
| 43 | + field('argument', optional($.preproc_arg)), |
| 44 | +- token.immediate(/\r?\n/), |
| 45 | ++ $._external_end_of_statement, |
| 46 | + ), |
| 47 | + |
| 48 | + ...preprocIf('', $ => repeat($._top_level_item)), |
0 commit comments