Permalink
Browse files

Merge branch 'master' of github.com:alanz/language-javascript

  • Loading branch information...
2 parents 7afbc26 + 77d3a6d commit a159e0851cfe75770a486d965198a7ce2033a298 @alanz alanz committed Apr 23, 2012
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*

0 comments on commit a159e08

Please sign in to comment.