-
Notifications
You must be signed in to change notification settings - Fork 16
/
JSON5.format.txt
55 lines (36 loc) · 3 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
46
47
48
49
50
51
52
53
54
55
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 #