-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathJSON5.format.txt
45 lines (32 loc) · 1.72 KB
/
JSON5.format.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
┏━━━━━━━━━━━┓
┃ JSON5 ┃
┗━━━━━━━━━━━┛
ALTERNATIVES ==> #See serialization formats summary
VERSION ==> #2.2.2
EXTENSION ==> #.json5
#MIME type application/json5, +json5
SYNTAX ==> #Superset of JSON, with the following additions, which are all:
# - optional
# - following JavaScript syntax
#In short: comments, unquoted VAR, trailing commas, multiline STR, NaN/Inf
┌──────────┐
│ MAIN │
└──────────┘
//COMMENT
/* COMMENT */ #
VAR: VAL #Follow JavaScript naming restrictions for OBJ properties.
#I.e. VAR can be unquoted under some conditions
TRAILING COMMA ==> #Allowed
TRAILING BACKSLASH ==> #Allowed
┌────────────┐
│ OTHERS │
└────────────┘
'VAR': VAL #Instead of "VAR": VAL
'STR' #Instead of "STR"
0xNUM
0XNUM #
.NUM #Instead of 0.NUM
+NUM #
Infinity
-Infinity
NaN #