Skip to content

Commit

Permalink
refactor!: un-alias strings in anonymouse nodes
Browse files Browse the repository at this point in the history
It does not make much sense to alias them here since they are not
identifiers, they are strings that represent a literal node rather than
a named node in the queries
  • Loading branch information
amaanq authored and clason committed May 25, 2024
1 parent a12c4a1 commit e6a7755
Show file tree
Hide file tree
Showing 6 changed files with 2,521 additions and 2,810 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = grammar({
),

anonymous_node: $ => seq(
field("name", choice(alias($.string, $.identifier), "_")),
field("name", choice($.string, "_")),
quantifier($),
captures($),
),
Expand Down
2 changes: 1 addition & 1 deletion queries/query/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(identifier) @type)

(anonymous_node
(identifier) @string)
(string) @string)

(predicate
name: (identifier) @function.call)
Expand Down
9 changes: 2 additions & 7 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 5 additions & 16 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e6a7755

Please sign in to comment.