|
1 | | -maml = space value space |
| 1 | +maml = ws-comment-newline value ws-comment-newline |
2 | 2 |
|
3 | 3 | value = object / array / string / multiline-string / number / "true" / "false" / "null" |
4 | 4 |
|
5 | | -object = "{" [ members ] space "}" |
| 5 | +object = "{" [ members ] ws-comment-newline "}" |
6 | 6 |
|
7 | | -members = space key-value ws [ comment ] separator members |
8 | | -members =/ space key-value space [ separator ] |
| 7 | +members = ws-comment-newline key-value ws [ comment ] separator members |
| 8 | +members =/ ws-comment-newline key-value ws [ comment ] [ separator ] |
9 | 9 |
|
10 | 10 | key-value = key ws ":" ws value |
11 | 11 |
|
12 | 12 | key = string / identifier |
13 | 13 |
|
14 | 14 | identifier = 1*( ALPHA / DIGIT / "-" / "_" ) |
15 | 15 |
|
16 | | -array = "[" [ items ] space "]" |
| 16 | +array = "[" [ items ] ws-comment-newline "]" |
17 | 17 |
|
18 | | -items = space value ws [ comment ] separator items |
19 | | -items =/ space value space [ separator ] |
| 18 | +items = ws-comment-newline value ws [ comment ] separator items |
| 19 | +items =/ ws-comment-newline value ws [ comment ] [ separator ] |
20 | 20 |
|
21 | 21 | separator = "," / newline |
22 | 22 |
|
@@ -45,22 +45,22 @@ integer = "0" / ( onenine *DIGIT ) |
45 | 45 | char = %x20-21 / %x23-5B / %x5D-10FFFF |
46 | 46 | char =/ %x5C ( %x5C / quote / "/" / "b" / "f" / "n" / "r" / "t" / "u" 4HEXDIG ) |
47 | 47 |
|
48 | | -space = *( ws [ comment ] ) |
49 | | - |
50 | 48 | comment = "#" *non-eol |
51 | 49 |
|
52 | 50 | non-eol = %x09 / %x20-7E / non-ascii |
53 | 51 |
|
54 | 52 | non-ascii = %x80-D7FF / %xE000-10FFFF |
55 | 53 |
|
| 54 | +ws-comment-newline = *( (SP / HTAB) / [ comment ] newline ) |
| 55 | + |
56 | 56 | newline = LF / CR LF |
57 | 57 |
|
58 | | -ws = *( SP / HTAB / LF / CR ) |
| 58 | +ws = *( SP / HTAB ) |
59 | 59 |
|
60 | 60 | SP = %x20 ; space |
| 61 | +HTAB = %x09 ; horizontal tab |
61 | 62 | CR = %x0D ; carriage return |
62 | 63 | LF = %x0A ; linefeed |
63 | | -HTAB = %x09 ; horizontal tab |
64 | 64 | ALPHA = %x41-5A / %x61-7A ; A-Z / a-z |
65 | 65 | DIGIT = %x30-39 ; 0-9 |
66 | 66 | HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" |
|
0 commit comments