From d27f9cb7cccb212110353fae82d2fc9a141dc620 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Fri, 28 Sep 2018 11:00:40 +0100 Subject: [PATCH] Disallow whitespace between a label and its open-parenthesis --- syndicate/mc/preserve.md | 16 +++++++++++++++- syndicate/mc/preserve.rkt | 1 - 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/syndicate/mc/preserve.md b/syndicate/mc/preserve.md index 5a5392f..2b784a1 100644 --- a/syndicate/mc/preserve.md +++ b/syndicate/mc/preserve.md @@ -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 diff --git a/syndicate/mc/preserve.rkt b/syndicate/mc/preserve.rkt index 2059ca7..01d52d7 100644 --- a/syndicate/mc/preserve.rkt +++ b/syndicate/mc/preserve.rkt @@ -452,7 +452,6 @@ [_ (loop (accumulate-one acc))]))) (define (collect-fields head) - (skip-whitespace) (match (peek-char i) [#\( (read-char i)