From de99b3cb3931f9e586a1dd36b5df026ed71c91ad Mon Sep 17 00:00:00 2001 From: Mikhail Gunin Date: Sat, 16 Nov 2024 17:31:58 +0300 Subject: [PATCH] Fix object property key token type closes #46 --- packages/tree-sitter-twig/corpus/expressions.txt | 6 +++--- packages/tree-sitter-twig/corpus/statements.txt | 4 ++-- packages/tree-sitter-twig/grammar.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/tree-sitter-twig/corpus/expressions.txt b/packages/tree-sitter-twig/corpus/expressions.txt index 6916318..94cf783 100644 --- a/packages/tree-sitter-twig/corpus/expressions.txt +++ b/packages/tree-sitter-twig/corpus/expressions.txt @@ -1,5 +1,5 @@ ================== -Identifier +Variable ================== {{ user }} --- @@ -184,10 +184,10 @@ Object property keys as names (output (object (pair - (variable) + (identifier) (string)) (pair - (variable) + (identifier) (string))))) ================== diff --git a/packages/tree-sitter-twig/corpus/statements.txt b/packages/tree-sitter-twig/corpus/statements.txt index 014cc46..a277bf4 100644 --- a/packages/tree-sitter-twig/corpus/statements.txt +++ b/packages/tree-sitter-twig/corpus/statements.txt @@ -710,7 +710,7 @@ With variables (with (object (pair - (variable) + (identifier) (number))) (source_elements (content)))) @@ -726,7 +726,7 @@ With variables only (with (object (pair - (variable) + (identifier) (number))) (source_elements (content)))) diff --git a/packages/tree-sitter-twig/grammar.js b/packages/tree-sitter-twig/grammar.js index 16eac6f..8b91230 100644 --- a/packages/tree-sitter-twig/grammar.js +++ b/packages/tree-sitter-twig/grammar.js @@ -215,7 +215,7 @@ module.exports = grammar({ choice( $.string, $.number, - alias($.identifier, $.variable), + $.identifier, $.computed_property_name, ),