summaryrefslogtreecommitdiff
path: root/ast.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-02-01 21:26:53 +0100
committertomsmeding <tom.smeding@gmail.com>2017-02-01 21:26:53 +0100
commit44ccdb3c72fad6daf995c0354e3ab75a3260ca9c (patch)
treed18c370193aa1e29956bd46bd6a318ec9b6227b8 /ast.hs
parentd5d642a170cd29e60c4d1dacd18ac4c5a8f8becd (diff)
Floats, bugfixes, small reorganisations
Diffstat (limited to 'ast.hs')
-rw-r--r--ast.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/ast.hs b/ast.hs
index 8cecab6..b1b31b7 100644
--- a/ast.hs
+++ b/ast.hs
@@ -38,6 +38,7 @@ data Type = TypeInt Int
deriving (Show, Eq)
data Literal = LitInt Integer
+ | LitFloat Double
| LitString String
| LitVar Name
| LitCall Name [Expression]
@@ -127,6 +128,7 @@ instance PShow Type where
instance PShow Literal where
pshow (LitInt i) = pshow i
+ pshow (LitFloat x) = pshow x
pshow (LitString s) = pshow s
pshow (LitVar n) = n
pshow (LitCall n a) = concat [n, "(", intercalate ", " (map pshow a), ")"]