Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #13 from aszlig/exponent_fix

Fix signed integers in exponents beginning with 0.
  • Loading branch information...
commit 77d3a6db99d50f443e10ede8cd8023fc7cd1f620 2 parents 39fed7e + 6f80eb4
@alanz authored
Showing with 6 additions and 5 deletions.
  1. +1 −0  runtests.hs
  2. +5 −5 src-dev/Language/JavaScript/Parser/Lexer.x
View
1  runtests.hs
@@ -64,6 +64,7 @@ testSuite = testGroup "Parser"
, testCase "LiteralDecimal13" (testLiteral "1e18" "Right (JSDecimal \"1e18\")")
, testCase "LiteralDecimal14" (testLiteral "1e+18" "Right (JSDecimal \"1e+18\")")
, testCase "LiteralDecimal15" (testLiteral "1e-18" "Right (JSDecimal \"1e-18\")")
+ , testCase "LiteralDecimal16" (testLiteral "1E-01" "Right (JSDecimal \"1E-01\")")
, testCase "LiteralOctal" (testLiteral "010" "Right (JSOctal \"010\")")
View
10 src-dev/Language/JavaScript/Parser/Lexer.x
@@ -243,11 +243,11 @@ tokens :-
-- | "0"
-- | "0." $digit+ { mkString decimalToken }
-<reg,divide> "0" "." $digit* ("e"|"E") ("+"|"-")? $non_zero_digit+ $digit*
- | $non_zero_digit $digit* "." $digit* ("e"|"E") ("+"|"-")? $non_zero_digit+ $digit*
- | "." $digit+ ("e"|"E") ("+"|"-")? $non_zero_digit+ $digit*
- | "0" ("e"|"E") ("+"|"-")? $non_zero_digit+ $digit*
- | $non_zero_digit $digit* ("e"|"E") ("+"|"-")? $non_zero_digit+ $digit*
+<reg,divide> "0" "." $digit* ("e"|"E") ("+"|"-")? $digit+
+ | $non_zero_digit $digit* "." $digit* ("e"|"E") ("+"|"-")? $digit+
+ | "." $digit+ ("e"|"E") ("+"|"-")? $digit+
+ | "0" ("e"|"E") ("+"|"-")? $digit+
+ | $non_zero_digit $digit* ("e"|"E") ("+"|"-")? $digit+
-- ++FOO++
| "0" "." $digit*
| $non_zero_digit $digit* "." $digit*
Please sign in to comment.
Something went wrong with that request. Please try again.