Questions Concepts
GitHub icon


JSON5 - Data notation

< >

JSON5 is an open source data notation created in 2012 by Aseem Kishore.

Source code:
git clone
#225on PLDB 11Years Old 0Repos

The JSON5 Data Interchange Format (JSON5) is a superset of JSON that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from ECMAScript 5.1.

Example from the web:
{ // comments unquoted: 'and you can quote me on that', singleQuotes: 'I can use "double quotes" here', lineBreaks: "Look, Mom! \ No \\n's!", hexadecimal: 0xdecaf, leadingDecimalPoint: .8675309, andTrailing: 8675309., positiveSign: +1, trailingComma: 'in objects', andIn: ['arrays',], "backwardsCompatible": "with JSON", }
Example from Linguist:
/* * The following is a contrived example, but it illustrates most of the features: */ { foo: 'bar', while: true, this: 'is a \ multi-line string', // this is an inline comment here: 'is another', // inline comment /* this is a block comment that continues on another line */ hex: 0xDEADbeef, half: .5, delta: +10, to: Infinity, // and beyond! finally: 'a trailing comma', oh: [ "we shouldn't forget", 'arrays can have', 'trailing commas too', ], }

Language features

Feature Supported Token Example
MultiLine Comments /* */
/* A comment
// A comment
Line Comments //
// A comment
[1, 2, 3]
{"name": "Mary"}
"hello world"
Semantic Indentation X
Case Insensitive Identifiers X
Multiline Strings X
File Imports X
Ternary operators X
Conditionals X
Macros X
Disk Output X

View source

- Build the next great programming language · Search · Add Language · Features · Creators · Resources · About · Blog · Acknowledgements · Queries · Stats · Sponsor · Traffic · Traffic Today · Day 305 · · Logout