arnetheduck / nph

An opinionated code formatter for Nim
Other
77 stars 12 forks source link

Simple lists turn sometimes complex depending on call syntax on first element #53

Closed kdeme closed 4 months ago

kdeme commented 4 months ago

Noticed a different behaviour depending on which syntax you use:

Formatted example:

const lista = [
  float64 239,
  240,
  241,
  242,
  243,
  244,
  245,
  246,
  247,
  248,
  249,
  250,
  251,
  252,
  253,
  254,
  255,
  256
]

const listb = [
  float64(239),
  240,
  241,
  242,
  243,
  244,
  245,
  246,
  247,
  248,
  249,
  250,
  251,
  252,
  253,
  254,
  255,
  256
]

const listc = [
  239.float64, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253,
  254, 255, 256
]

const listd = [
  239.float64(),
  240,
  241,
  242,
  243,
  244,
  245,
  246,
  247,
  248,
  249,
  250,
  251,
  252,
  253,
  254,
  255,
  256
]

const liste = [
  239'f64, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254,
  255, 256
]

I would expect all lists to get formatted as listc and liste.