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

fix: improve jumps and class qualifiers #105

Merged
merged 1 commit into from
Nov 8, 2023
Merged

fix: improve jumps and class qualifiers #105

merged 1 commit into from
Nov 8, 2023

Conversation

ObserverOfTime
Copy link
Contributor

Upon reviewing nvim-treesitter/nvim-treesitter#5527 I noticed that (a) the jump expression labels are anonymous nodes and (b) the _this_at and _super_at rules are unused. This change makes it easier to capture the labels and classes and ensures that qualified calls are parsed as expected. I wanted to use token.immediate("@") in all of the *_at rules but the label rule would take precedence (even after editing it and raising the other rules' precedence) so I had to compromise.

@github-actions github-actions bot added the grammar Related to the grammar label Oct 15, 2023
@ObserverOfTime
Copy link
Contributor Author

ObserverOfTime commented Oct 16, 2023

I suppose this fixes #5.

this@A.foo = null
(source_file [0, 0] - [1, 0]
  (assignment [0, 0] - [0, 17]
    (directly_assignable_expression [0, 0] - [0, 10]
      (this_expression [0, 0] - [0, 6]
        (type_identifier [0, 5] - [0, 6]))
      (navigation_suffix [0, 6] - [0, 10]
        (simple_identifier [0, 7] - [0, 10])))))

It also takes care of #43.

@ObserverOfTime
Copy link
Contributor Author

Hello? :)

@VladimirMakaev
Copy link
Collaborator

@ObserverOfTime looked at your PR, seems legit and not super risky, merging.

@VladimirMakaev VladimirMakaev merged commit 16de60e into fwcd:main Nov 8, 2023
2 checks passed
@ObserverOfTime ObserverOfTime deleted the patch-1 branch November 8, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grammar Related to the grammar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants