alex-pinkus / tree-sitter-swift

A tree-sitter grammar for the Swift programming language.
MIT License
137 stars 35 forks source link

Add support for SE-0393 #385

Closed alex-pinkus closed 6 months ago

alex-pinkus commented 6 months ago

This adds new rules for parameter packs and expansions in both type and expression position. Since this includes the keyword "repeat", which was already a keyword for a do-while loop, we must modify the do-while loop rule so that it remains valid long enough to disqualify the parameter-pack interpretation.

With this change, it's starting to look like the "contextual keyword that is special cased as an identifier" pattern is going to become more standard. To facilitate that, this creates an explicit (hidden) rule for it.

Fixes #381