From 7bc79b0743468ddb765f38e1317d864a6be23861 Mon Sep 17 00:00:00 2001 From: hectorhon Date: Wed, 20 Aug 2025 16:33:11 +0800 Subject: [PATCH] Fix undefined error /home/runner/work/tree-sitter-langs/tree-sitter-langs/repos/yaml/grammar.js:676 for (const [rule_name, rule] of Object.entries(grammar_json.rules)) { ^ TypeError: Cannot read properties of undefined (reading 'rules') at global_alias (/home/runner/work/tree-sitter-langs/tree-sitter-langs/repos/yaml/grammar.js:676:63) at Object. (/home/runner/work/tree-sitter-langs/tree-sitter-langs/repos/yaml/grammar.js:567:39) at Module._compile (node:internal/modules/cjs/loader:1529:14) at Module._extensions..js (node:internal/modules/cjs/loader:1613:10) at Module.load (node:internal/modules/cjs/loader:1275:32) --- grammar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammar.js b/grammar.js index b8b36d0..b3698e7 100644 --- a/grammar.js +++ b/grammar.js @@ -564,7 +564,7 @@ module.exports = grammar({ }, }); -module.exports.grammar = global_alias(global_alias(module.exports.grammar, { +module.exports = global_alias(global_alias(module.exports, { ..._('yaml_directive', '_s_dir_yml'), ..._('yaml_version', '_r_dir_yml_ver'), ..._('tag_directive', '_s_dir_tag'),