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!: rename list to alternation #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented May 24, 2024

Problem

In tree-sitter's query syntax, the construct described as a list in the current grammar is actually known as an alternation - see https://tree-sitter.github.io/tree-sitter/using-parsers#alternations

It would be better to rename this node to alternation, since it correctly captures what this node actually means in terms of the query syntax itself

Solution

Rename the node to alternation

@clason
Copy link
Contributor

clason commented May 24, 2024

Note: this will break https://github.com/neovim/neovim/blob/2c6b6358722b2df9160c3739b0cea07e8779513f/runtime/lua/vim/treesitter/_query_linter.lua#L66-L78

Let me think whether it's possible to handle that gracefully -- right now, I don't see a way, in which case I don't think the more appropriate name is worth it.

The correct term is alternation, and correctly captures what this node
actually means in terms of the query syntax itself
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.

2 participants