agoric-labs / jessica

Jessica - Jessie (secure distributed Javascript) Compiler Architecture
Apache License 2.0
35 stars 9 forks source link

No octal numbers in json, jessie, ses, or es-strict #2

Closed erights closed 5 years ago

erights commented 5 years ago

https://github.com/michaelfig/jessica/blob/ebb045a2afbf5bfec1f4f6b3da7aee04b4d45c65/lib/boot-peg.mjs#L194 says

// FIXME: Handle octal integers.

To be clear, the handling should be to report a syntax error. See json grammar

michaelfig commented 5 years ago

Actually, the octal support is only for the peg tag, which needs it to bootstrap the utf8 support I'm adding to the JSON grammar.

json and its derivatives will not support octal (just as they don't support any of the other quasi-peg.mjs productions).

On Wed, Jan 9, 2019 at 3:17 PM Mark S. Miller notifications@github.com wrote:

https://github.com/michaelfig/jessica/blob/ebb045a2afbf5bfec1f4f6b3da7aee04b4d45c65/lib/boot-peg.mjs#L194 says

// FIXME: Handle octal integers.

To be clear, the handling should be to report a syntax error. See json grammar

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/michaelfig/jessica/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AAb6HKzoMGacJvNGGAnj4i50NoSdQZn0ks5vBlxpgaJpZM4Z4POe .

erights commented 5 years ago

Aha! Makes sense.

michaelfig commented 5 years ago

Just to be more consistent, quasi-peg.mjs has dropped support for octal, and now only supports \xFF-style character codes.

erights commented 5 years ago

See http://json.org . Please support only \uFFFF .

michaelfig commented 5 years ago

As described before, this is only a change to the grammar for peg grammars. quasi-json.mjs continues to accept only \uFFFF.