kdl-org / kdl

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

Make continuation character optional if next line starts with prop #147

Closed nichtich closed 3 years ago

nichtich commented 3 years ago

Lists of properties become difficult to read and write by hand if they get too long:

data answer=42 author="Douglas Adams" work="The Hitchhiker's Guide to the Galaxy"

data answer=42 \
     author="Douglas Adams" \
     work="The Hitchhiker's Guide to the Galaxy"

Either you get a very long line or you must take care not to forget the continuation character \ and to remove it after the last property (like , in JSON).

As far as I read the spec, a line must not start with a property (because bare identifiers must not contain =). This would be invalid in KDL 1.0.0:

data answer=42
     author="Douglas Adams"
     work="The Hitchhiker's Guide to the Galaxy"

Why not let the parser assume continuation of a node in this case (instead of syntax error)?