astrale-sharp / typstfmt

Apache License 2.0
253 stars 25 forks source link

[bug] Removes trailing comma from array with 1 element (as a function parameter) #71

Closed Andrew15-5 closed 1 year ago

Andrew15-5 commented 1 year ago

Before

#let func((a,)) = {
}

...

#let config = (
  a: "value"
)
#func(config)

After:

#let func((a)) = {}

There's even a compile error:

error: expected identifier, named pair or argument sink, found group
  ┌─ file.typ:3:10
  │
3 │ #let func((a)) = {}
  │           ^^^
astrale-sharp commented 1 year ago

I didn't think of patters in func arguments, I'll get to it! (expect a few days of delay, or else don't hesitate to PR if you're in a hurry, i could give pointers)!

thanks for the report!

astrale-sharp commented 1 year ago

This is solved on master!