kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.14k stars 62 forks source link

Grammar allows whitespace in `(tag) "string"` - intentional? #131

Closed tabatkins closed 3 years ago

tabatkins commented 3 years ago

Currently the grammar for values is value := (type ws*)? (string | number | keyword), implying that (tag) "string" is valid. The explanatory text preceding this, tho, says that no whitespace is allowed between the type and the value.

Is this an intentional divergence - a behavior technically allowed but recommended against? Or is the ws* just an accidental leftover of an early attempt at the feature, before it was decided that ws should be disallowed?

zkat commented 3 years ago

that seems like an oopsie poopsie on my part. What should be the canonical way? I don't mind either one. i don't think there's any parsing issues with having that ws* tho

tabatkins commented 3 years ago

I don't have a strong opinion, but lightly lean towards no whitespace; the type is tightly bound to the value, and disallowing whitespace seems to keep that relationship slightly more explicit.

zkat commented 3 years ago

I'm fine removing the ws* then. Saves us the headache of figuring out how linespace might possibly interact with this, and you can't have spaces around = anyway :)

tabatkins commented 3 years ago

k, since it would cause a conflict with #133, I'll wait until that's merged to make a PR ^_^

zkat commented 3 years ago

done :)

zkat commented 3 years ago

This was fixed as part of #132. Thanks!