Browse Source

Removed subtraction and division from the example grammar because of wrong associativity.

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

2
examples/arithmetics.pegjs

@ -6,11 +6,9 @@
start : additive
additive : multiplicative "+" additive { return $1 + $3; }
/ multiplicative "-" additive { return $1 - $3; }
/ multiplicative
multiplicative : primary "*" multiplicative { return $1 * $3; }
/ primary "/" multiplicative { return $1 / $3; }
/ primary
primary : integer

Loading…
Cancel
Save