On 4/13/06, Kirill Simonov <xi@gamma.dn.ua> wrote:
I believe any rules like
        a key cannot contain any ":"
are ambiguous. After all, keys are defined as something that is followed by
":", so saying that ":" is forbidden in keys is tautology.

Not so. Plain keys are deifines as something followed by a ": ".  We'll only allow the space after the colon to be omitted when the key is quoted - like this: {"1":2} - for JSON compatibility.

For instance, how will you parse
        [1:2]

It can be correctly parsed as
        [ { !!int "1": !!int "2" } ]    # neither key nor value contain ":"
and
        [ !!int "1:2" ] # it's a value, so it can contain ":"

Both interpretations are valid according to above rules.

Only the 2nd interpretation is valid.

Have fun,

    Oren Ben-Kiki