@@ -12,15 +12,25 @@ num :: IParser L.Literal
12num = toLit <$> (number <?> "number")
12num = toLit <$> (number <?> "number")
15+ | 'x' `elem` n = L.IntNum (read n)
15 | any (`elem` ".eE") n = L.FloatNum (read n)
16 | any (`elem` ".eE") n = L.FloatNum (read n)
16 | otherwise = L.IntNum (read n)
17 | otherwise = L.IntNum (read n)
18 number = concat <$> sequence
19 number = concat <$> sequence
19 [ option "" minus
20 [ option "" minus
21+ , hexNum <|> decNum ]
23+ decNum = concat <$> sequence
20− , many1 digit
24+ [ many1 digit
21 , option "" decimals
25 , option "" decimals
22 , option "" exponent ]
26 , option "" exponent ]
29+ try $ lookAhead (string "0x" >> hexDigit)
24 minus = try $ do
34 minus = try $ do
25 string "-"
35 string "-"
26 lookAhead digit
36 lookAhead digit