Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document commas and semi-colons #16

Closed
hollasch opened this issue Sep 15, 2018 · 2 comments
Closed

Document commas and semi-colons #16

hollasch opened this issue Sep 15, 2018 · 2 comments
Assignees

Comments

@hollasch
Copy link
Owner

This one slipped through the cracks. Though , and ; characters are used throughout the LSON document, they're not explicitly documented anywhere.

So far, they've been used as syntactic sugar to optionally terminate values. Now that we might tackle default values for tabular data, we need to actually nail down their syntax.

Note that they're currently defined in the grammar section, as <terminator> lexemes.

@hollasch
Copy link
Owner Author

One thought I'd had was to optionally allow , and ; characters, but to provide some formal syntax, in order to prevent misleading text, such as [ a, b, , , c, d, , , e, , f ] (six values, but looks like 11, with some explicitly empty content). One could accomplish this by making sequences with two or more ,/; characters illegal.

Unfortunately, it would be just as misleading to have something like [ a b; c d; e f; ] — six values, but looks like three pairs. It's not too hard to create a simple grammar that forbids multiple terminators in a row (LSON doesn't support semantically meaningful empty/null text). However, there's no easy way to require every element to use a terminator if any element does.

One could create a grammar with, say, an array of unterminated elements and an array of terminated ones, but that might be fussy. For consistency, though, this is the only rigorous solution.

@hollasch
Copy link
Owner Author

Things that might include optional terminators:

  • Arrays
  • Objects
  • Table fields
  • Table rows
  • Table row contents
  • Element values would treat , and ; characters literally, but they also do that for whitespace.
  • Object multi-keys
  • Graph node data
  • Graph nodes
  • Graph edges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant