diff options
| author | krasimir <krasimir@chalmers.se> | 2010-01-27 09:39:14 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-01-27 09:39:14 +0000 |
| commit | 890d45579300f39d50a5a18a9f6feed8634ae8ba (patch) | |
| tree | 056af80026eea5d67b68ef74f50ee5931566c822 /src/runtime/haskell/PGF/Expr.hs | |
| parent | b206aa3464bf8b766b61a31efb72d03c7dd3c1a9 (diff) | |
cleanup the code of the PGF interpreter and polish the binary serialization to match the preliminary specification
Diffstat (limited to 'src/runtime/haskell/PGF/Expr.hs')
| -rw-r--r-- | src/runtime/haskell/PGF/Expr.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime/haskell/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs index 2357026ab..674422217 100644 --- a/src/runtime/haskell/PGF/Expr.hs +++ b/src/runtime/haskell/PGF/Expr.hs @@ -31,7 +31,7 @@ import qualified Text.ParserCombinators.ReadP as RP data Literal =
LStr String -- ^ string constant
- | LInt Integer -- ^ integer constant
+ | LInt Int -- ^ integer constant
| LFlt Double -- ^ floating point constant
deriving (Eq,Ord,Show)
@@ -116,11 +116,11 @@ unStr (ELit (LStr s)) = Just s unStr _ = Nothing
-- | Constructs an expression from integer literal
-mkInt :: Integer -> Expr
+mkInt :: Int -> Expr
mkInt i = ELit (LInt i)
-- | Decomposes an expression into integer literal
-unInt :: Expr -> Maybe Integer
+unInt :: Expr -> Maybe Int
unInt (ELit (LInt i)) = Just i
unInt _ = Nothing
@@ -236,7 +236,7 @@ ppBind Explicit x = ppCId x ppBind Implicit x = PP.braces (ppCId x)
ppLit (LStr s) = PP.text (show s)
-ppLit (LInt n) = PP.integer n
+ppLit (LInt n) = PP.int n
ppLit (LFlt d) = PP.double d
ppMeta :: MetaId -> PP.Doc
|
