tree-sitter-swift
tree-sitter-swift copied to clipboard
Parse `package` visibility modifier.
No highlighting changes needed for this to look nice:
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.
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!
Ah, well now ./scripts/top-repos.sh 25
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...
I added a _contextual_simple_identifier rule in #385 that should be the right place to put these going forward.
This was super close to being done so I finished it up in #407.