From 2a80964796a08b6fb8e5d18e671ab390281620d4 Mon Sep 17 00:00:00 2001 From: Alex Pinkus Date: Tue, 8 Mar 2022 21:52:55 -0800 Subject: [PATCH] Manually inline `_locally_permitted_modifiers` See https://github.com/returntocorp/ocaml-tree-sitter-semgrep/issues/286 When generating a simplified grammar, the `ocaml-tree-sitter` code generator forces all hidden nodes to be visible. It appears that hidden nodes automatically get marked as `inline`, and that without that auto-inlining, the `_locally_permitted_modifiers` rule causes a conflict. Rather than making the semgrep folks work around their conflict, we just check the `inline` declaration into the grammar itself so that it sticks around in the simplified grammar. --- grammar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grammar.js b/grammar.js index 0685f29..9833f6f 100644 --- a/grammar.js +++ b/grammar.js @@ -214,6 +214,7 @@ module.exports = grammar({ $._as_bang_custom, $._async_keyword_custom, ], + inline: ($) => [$._locally_permitted_modifiers], rules: { //////////////////////////////// // File Structure