JSON example: Expand some one-line rules to multiple lines

Blocks of one-line rules with aligned "=" signs should be used only in
cases where the rules are symmetric and we want to emphasize that.

Follow-up to ff7193776e.
redux
David Majda 8 years ago
parent 1508e804a6
commit 2baeace235

@ -84,15 +84,32 @@ array
number "number" number "number"
= minus? int frac? exp? { return parseFloat(text()); } = minus? int frac? exp? { return parseFloat(text()); }
decimal_point = "." decimal_point
digit1_9 = [1-9] = "."
e = [eE]
exp = e (minus / plus)? DIGIT+ digit1_9
frac = decimal_point DIGIT+ = [1-9]
int = zero / (digit1_9 DIGIT*)
minus = "-" e
plus = "+" = [eE]
zero = "0"
exp
= e (minus / plus)? DIGIT+
frac
= decimal_point DIGIT+
int
= zero / (digit1_9 DIGIT*)
minus
= "-"
plus
= "+"
zero
= "0"
// ----- 7. Strings ----- // ----- 7. Strings -----
@ -117,9 +134,14 @@ char
) )
{ return sequence; } { return sequence; }
escape = "\\" escape
quotation_mark = '"' = "\\"
unescaped = [^\0-\x1F\x22\x5C]
quotation_mark
= '"'
unescaped
= [^\0-\x1F\x22\x5C]
// ----- Core ABNF Rules ----- // ----- Core ABNF Rules -----

Loading…
Cancel
Save