This release tightens JSON5 support and adds helpful utility features:
-
Support hexadecimal numbers. (Thanks @MaxNanasy.)
-
Reject octal numbers properly now. Previously, they were accepted but improperly parsed as base-10 numbers. (Thanks @MaxNanasy.)
-
Breaking: Reject "noctal" numbers now (base-10 numbers that begin with a leading zero). These are disallowed by both JSON5 and JSON, as well as by ES5's strict mode. (Thanks @MaxNanasy.)
-
Support leading decimal points in decimal numbers. (Thanks @MaxNanasy.)
-
Breaking: Reject trailing decimal points in decimal numbers now. These are disallowed by both JSON5 and JSON. (Thanks @MaxNanasy.)
-
Breaking: Reject omitted elements in arrays now. These are disallowed by both JSON5 and JSON.
-
Throw proper
SyntaxErrorinstances on errors now. -
Add Node.js
require()hook. Requirejson5/lib/requireto register it. -
Add Node.js executable to compile JSON5 files to JSON. Run with
json5.
This was the first implementation of this JSON5 parser.
-
Support unquoted object keys, including reserved words. Unicode characters and escape sequences sequences aren't yet supported.
-
Support single-quoted strings.
-
Support multi-line strings.
-
Support trailing commas in arrays and objects.
-
Support comments, both inline and block.
v0.0.0 [code]
Let's consider this to be Douglas Crockford's original json_parse.js — a parser for the regular JSON format.