From 8f2aa1e834c936fda7830b731046edc601131383 Mon Sep 17 00:00:00 2001 From: David Majda Date: Thu, 18 Mar 2010 20:06:55 +0100 Subject: [PATCH] Fixed a bug in the example grammar where integers beginning with 0 were parsed as octal. --- examples/arithmetics.pegjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arithmetics.pegjs b/examples/arithmetics.pegjs index 4cb2fd5..2e05deb 100644 --- a/examples/arithmetics.pegjs +++ b/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); }