JSON-Z Grammar

Features which exceed the JSON specification are flagged with the minimal feature set required for parsing them, in a hierarchy from least to most permissive: JSONC, JSON5, JSON-Z.

Overview

overview

Basic character classes

characters

Numbers

numbers

Simplified numbers

This is what the number productions look like when the complications of underscore separators, leading/trailing decimal points, and implicit octal numbers are removed.

simplified numbers

Strings

strings

Comments

comments

Extended types

The form of an extended type mirrors that of a JavaScript function call, allowing these values to be parsed as JSONP, via the JavaScripteval function, or via the safer JavaScript new Function(...) technique, so long as evaluation takes place in a context where the named functions are defined.

The JSONZ.globalizeTypeHandlers() function can be used to establish such a context.

extended types