Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: un-alias strings in anonymous nodes #38

Merged
merged 1 commit into from
May 25, 2024
Merged

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented May 24, 2024

Problem

When viewing or using a parse tree of a query file in the parser's current state, all strings in an anonymous node are aliased to an identifier, thus making it seem like it's an identifier, when it's actually a string. 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

Solution

Un-alias strings to identifiers in anonymous nodes

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
@clason
Copy link
Contributor

clason commented May 24, 2024

@amaanq
Copy link
Member Author

amaanq commented May 24, 2024

It does not, since anonymous_node's child is captured as a wildcard rather than explicitly seeking for (identifier)

However #39 does since (list) is used and would have to be renamed to (alternation)

@clason clason changed the title refactor!: un-alias strings in anonymouse nodes refactor!: un-alias strings in anonymous nodes May 24, 2024
@clason
Copy link
Contributor

clason commented May 24, 2024

@lucario387

@lucario387
Copy link

I'm ok with this.

@clason clason merged commit e6a7755 into master May 25, 2024
3 checks passed
@clason clason deleted the remove-alias branch May 25, 2024 07:44
@clason
Copy link
Contributor

clason commented May 25, 2024

Merged. I will not merge #39 (at this time), so go ahead with the nvim-treesitter PR @amaanq

phattai6883

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants