-
Notifications
You must be signed in to change notification settings - Fork 16
/
cson.format.txt
49 lines (31 loc) · 2.71 KB
/
cson.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
CSON
ALTERNATIVES ==> #See serialization formats summary
#Extremely slow on parsing (500 times slower than JSON), but ok on stringify
SYNTAX ==> #Like JSON, but following additions (taken from CoffeeScript)
/=+===============================+=\
/ : : \
)==: SYNTAX :==(
\ :_______________________________: /
\=+===============================+=/
INDENTATION ==> #Instead of braces, but braces can optionally be used
NEWLINE ==> #Instead of commas, but commas can optionally be used
#COMMENT
###
COMMENT
### #
VAR: VAL #Instead of "VAR": VAL (still possible)
#Providing same restrictions as unquoted { VAR: VAL } in JavaScript
'VAR': VAL #Instead of "VAR": VAL
'STR' #Instead of "STR"
"...
...
..." #Multiline STR. Newline + leading whitespaces converted to single space
"""
... #Multiline STR.
""" #Keeps all whitespaces except initial tabs (based on the line with the smallest indentation)
///...
...
... #Multiline REGEXP. Newline + leading|trailing whitespaces ignored
.../// #Trailing comments ignored