kdl-org / kdl

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

Require node terminator before eof #116

Closed zkat closed 3 years ago

zkat commented 3 years ago

Discussed in https://github.com/kdl-org/kdl/discussions/39

Originally posted by **zkat** December 17, 2020 I think we should make it a requirement to have either a newline or a ; as the last character in a document. This means that accidentally truncated files will simply fail to parse. on the flip side, it means that folks who don't put a final newline in their files still get obnoxious errors, which kinda sucks but I assume most editors will help people do the right thing here?
zkat commented 3 years ago

(note: I am disinclined to do this. I think requiring a newline at the end of a file is going to cause more heartache than it's worth, but I'm open to opinions)

zkat commented 3 years ago

Twitter has spoken: https://twitter.com/zkat__/status/1432949552651255814

so I'm just gonna leave things as they are. EOFs are fine terminators. There's better ways to verify a file isn't getting truncated anyway (such as putting the entire document inside a single parent node).