ndjson / ndjson-spec

Specification
680 stars 29 forks source link

Use ABNF in spec #22

Open finnp opened 9 years ago

finnp commented 9 years ago

I noticed that it might be easier to understand and quicker to grasp to use BNF in the spec.

ndjson = *(JSON-line newline)
newline = %x0A                ; Line feed or Newline
JSON-line = JSON-Text \ %x0A ; JSON-Text without Newline character

JSON-line is the JSON-Text from the RFC7159 JSON spec without the usage of a the newline (\n) character.

This also makes clear that empty lines aren't actually allowed in the spec and that we merely recommend parsers to allow this as an option.

Also it easily shows that the last line should be a newline.

hoegertn commented 9 years ago

Sounds cool.