Disallow whitespace between a label and its open-parenthesis

This commit is contained in:
Tony Garnock-Jones 2018-09-28 11:00:40 +01:00
parent d267f65b71
commit d27f9cb7cc
2 changed files with 15 additions and 2 deletions

View File

@ -296,7 +296,7 @@ Any `Value` may be preceded by whitespace.
Each `Record` is its label-`Value` followed by a parenthesised
grouping of its field-`Value`s.
Record = Value ws "(" *Value ws ")"
Record = Value "(" *Value ws ")"
`Sequence`s are enclosed in square brackets. `Dictionary` values are
curly-brace-enclosed colon-separated pairs of values. `Set`s are
@ -1373,4 +1373,18 @@ and I don't know what to do about SignedIntegers. Perhaps make them
more like float formats, with the byte count acting as a kind of
exponent underneath the sign bit.
- Perhaps define separate additional canonicalization restrictions?
Doesn't help the ordering, but does help the equivalence.
- Canonicalization and early-bailout-equivalence-checking are in
tension with support for streaming values.
Q. The postfix fields in the textual syntax come unannounced: "oh, and
another thing, what you just read is a label, and here are some
fields." This is a problem for interactive reading of textual syntax,
because after a complete term, it needs to see the next character to
tell whether it is an open-parenthesis or not! For this reason, I've
disallowed whitespace between a label `Value` and the open-parenthesis
of the fields. Is this reasonable??
## Notes

View File

@ -452,7 +452,6 @@
[_ (loop (accumulate-one acc))])))
(define (collect-fields head)
(skip-whitespace)
(match (peek-char i)
[#\(
(read-char i)