JSON5.stringify
produces a String that conforms to the following JSON5 grammar.
JSON5.parse
accepts a String that conforms to the JSON5 grammar.
JSON5 is similar to ECMAScript source text in that it consists of a sequence of characters conforming to the rules of SourceCharacter. The JSON5 Lexical Grammar defines the tokens that make up a JSON5 text similar to the manner that the ECMAScript lexical grammar defines the tokens of an ECMAScript source test. The JSON5 lexical grammar shares some productions with the ECMAScript lexical grammar. All nonterminal symbols of the grammar that do not begin with the characters "JSON5" are defined by productions of the ECMAScript lexical grammar.
JSON5WhiteSpace ::
<TAB>
<CR>
<LF>
<SP>
JSON5Comment ::
JSON5Identifier ::
JSON5IdentifierStart
JSON5Identifier JSON5IdentifierPart
JSON5IdentifierStart ::
JSON5Letter
$
_
JSON5IdentifierPart ::
JSON5IdentifierStart
JSON5Letter
A
throughZ
ora
throughz
JSON5NullLiteral ::
JSON5BooleanLiteral ::
JSON5Number ::
JSON5String ::
The JSON5 Syntactic Grammar defines a valid JSON5 text in terms of tokens defined by the JSON5 lexical grammar. The goal symbol of the grammar is JSON5Text.
JSON5Text :
JSON5Value
JSON5Value :
JSON5NullLiteral
JSON5BooleanLiteral
JSON5Object
JSON5Array
JSON5String
JSON5Number
JSON5Object :
{
}
{
JSON5MemberList,
opt}
JSON5MemberList :
JSON5Member
JSON5MemberList
,
JSON5Member
JSON5Member :
JSON5MemberName
:
JSON5Value
JSON5MemberName :
JSON5Identifier
JSON5String
JSON5Array :
[
]
[
JSON5ElementList,
opt]
JSON5ElementList :
JSON5Value
JSON5ElementList
,
JSON5Value