alex-pinkus / tree-sitter-swift

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

Support SE-0393: Parameter Packs #381

Closed patrickt closed 6 months ago

patrickt commented 6 months ago

This enhancement introduces a lot of new syntax. Right now the highlighter manages to recognize repeat but it has difficulty with each and friend.

func makePairs<each First, each Second>(
  firsts first: repeat each First,
  seconds second: repeat each Second
) -> (repeat Pair<each First, each Second>) {
  return (repeat Pair(each first, each second))
}
jtbandes commented 6 months ago

for comparison :)

```swift
func makePairs<each First, each Second>(
  firsts first: repeat each First,
  seconds second: repeat each Second
) -> (repeat Pair<each First, each Second>) {
  return (repeat Pair(each first, each second))
}
alex-pinkus commented 6 months ago

This looks like someone spilled a bowl of keyword soup on the floor lmao

alex-pinkus commented 6 months ago

I suppose if the swift folks want to make their language look like this, I have no choice but to be complicit