Browse Source

Fixed a bug in the example grammar where integers beginning with 0 were parsed as octal.

redux
David Majda 12 years ago
parent
commit
8f2aa1e834
  1. 2
      examples/arithmetics.pegjs

2
examples/arithmetics.pegjs

@ -14,4 +14,4 @@ multiplicative : primary "*" multiplicative { return $1 * $3; }
primary : integer
/ "(" additive ")" { return $2; }
integer "integer" : [0-9]+ { return parseInt($1.join("")); }
integer "integer" : [0-9]+ { return parseInt($1.join(""), 10); }
Loading…
Cancel
Save