From 2925aae258dcc44101fde10910792b6d3b18f16f Mon Sep 17 00:00:00 2001 From: RedCMD Date: Wed, 4 Sep 2024 17:47:40 +1200 Subject: [PATCH] Fix `#include` names containing `$self` --- src/tree-sitter/tree-sitter-json/grammar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tree-sitter/tree-sitter-json/grammar.js b/src/tree-sitter/tree-sitter-json/grammar.js index 268b72c..af8009b 100644 --- a/src/tree-sitter/tree-sitter-json/grammar.js +++ b/src/tree-sitter/tree-sitter-json/grammar.js @@ -168,7 +168,14 @@ module.exports = grammar({ ), _includeRuleName: $ => fieldAlias($, 'ruleName', - $._string, + token( + repeat1( + choice( + /\\[^\r\n\t]/, + /[^\\\r\n\t"]+/, + ), + ), + ), ), _self: $ => fieldAlias($, 'self',