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

Parse package visibility modifier. #383

Closed
wants to merge 5 commits into from

Conversation

patrickt
Copy link
Contributor

No highlighting changes needed for this to look nice:
image

@alex-pinkus
Copy link
Owner

Looks like this causes a parse failure on line 39 of: https://github.com/daltoniam/Starscream/blob/master/Package.swift#L39

we might need to special-case this as an allowed identifier, like we do with async, so that tree-sitter doesn’t choose the keyword over the identifier too early.

@alex-pinkus
Copy link
Owner

You should be able to run top-repos locally btw — in this case ./scripts/top-repos.sh 36 will test exactly the failing repository

A corpus test for this case would be greatly appreciated too!

@alex-pinkus
Copy link
Owner

Ah, well now ./scripts/top-repos.sh 25

@alex-pinkus
Copy link
Owner

Maybe try adding it to the simple_identifier declaration itself here? Then it would cover the enum case we see from Moya. Sorry for pointing you in the wrong direction, I thought that was where I special cased async too...

@alex-pinkus
Copy link
Owner

I added a _contextual_simple_identifier rule in #385 that should be the right place to put these going forward.

@alex-pinkus alex-pinkus mentioned this pull request Apr 22, 2024
@alex-pinkus
Copy link
Owner

This was super close to being done so I finished it up in #407.

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