kdl-org / kdl

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

Grammar seems to allow multiline after line continuation despite the Spec #322

Closed eugenesvk closed 8 months ago

eugenesvk commented 1 year ago

Spec tells us that only single-line comments are optional after whitespace characters

A line continuation is a \ character followed by zero or more whitespace characters and an optional single-line comment.

The grammar defines escline := '\\' ws* (single-line-comment | newline) but then ws also includes multi-line comments ws := bom | unicode-space | multi-line-comment

Which one is supposed to be correct in this case? Or is this properly resolved via some other rule?

zkat commented 8 months ago

I think this is fine. The spec text is meant to be more of a high-level idea of how things work. The grammar is authoritative. I'm happy taking a patch to reword things if it helps.

zkat commented 8 months ago

This is fixed in the kdl-v2 branch now.