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

Add var to contextual keywords #280

Merged
merged 5 commits into from
Jan 13, 2023

Conversation

tamasvajk
Copy link
Collaborator

Fixes #163.

Adding var as a contextual keyword meant that implicit type and name conflicted, and because they could show up in the same position in an AST as a type, dynamic precedence was specified to prefer implicit type. I didn't want to modify the _name rule, but only cases when _name is used as a type, so I introduced an intermediate wrapper that adds the dynamic precedence.

@tamasvajk tamasvajk marked this pull request as ready for review January 12, 2023 12:33
@tamasvajk tamasvajk requested a review from damieng January 12, 2023 12:33
grammar.js Outdated
[$._type_name, $._array_base_type],
[$._type_name, $._pointer_base_type],
[$._type_name, $._ref_base_type],

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase and run with the line number scripts. I'm getting anxious about all these conflict rules.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the rebase, these are not needed. I've pushed a commit with the file sizes, there's basically no change.

@tamasvajk tamasvajk force-pushed the contextual-keywords-var branch from f85da59 to 524eb59 Compare January 13, 2023 23:40
@tamasvajk tamasvajk merged commit 98a2879 into tree-sitter:master Jan 13, 2023
@tamasvajk tamasvajk mentioned this pull request Feb 5, 2023
2 tasks
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.

Parse error when operating on variable named var
2 participants