diff options
| author | Max Bolingbroke <batterseapower@hotmail.com> | 2011-05-15 18:50:54 +0100 |
|---|---|---|
| committer | Max Bolingbroke <batterseapower@hotmail.com> | 2011-05-15 19:36:52 +0100 |
| commit | 3391a03562d4056de7b16cd0f632e6c43ae44cca (patch) | |
| tree | 22347ea65b37da5e60da9c656270e2f0e6fa423c /compiler/parser | |
| parent | ee5addccd1929a7368a39b2c88d1b77f0bc8fb73 (diff) | |
| download | haskell-3391a03562d4056de7b16cd0f632e6c43ae44cca.tar.gz | |
Record the original text along with parsed Rationals: fixes #2245
Diffstat (limited to 'compiler/parser')
| -rw-r--r-- | compiler/parser/Lexer.x | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 46f7488dcc..27424323c6 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -68,7 +68,7 @@ import UniqFM import DynFlags import Module import Ctype -import BasicTypes ( InlineSpec(..), RuleMatchInfo(..) ) +import BasicTypes ( InlineSpec(..), RuleMatchInfo(..), FractionalLit(..) ) import Util ( readRational ) import Control.Monad @@ -541,7 +541,7 @@ data Token | ITchar Char | ITstring FastString | ITinteger Integer - | ITrational Rational + | ITrational FractionalLit | ITprimchar Char | ITprimstring FastString @@ -1061,7 +1061,7 @@ hexadecimal = (16,hexDigit) -- readRational can understand negative rationals, exponents, everything. tok_float, tok_primfloat, tok_primdouble :: String -> Token -tok_float str = ITrational $! readRational str +tok_float str = ITrational $! FL { fl_text = str, fl_value = readRational str } tok_primfloat str = ITprimfloat $! readRational str tok_primdouble str = ITprimdouble $! readRational str |
