aboutsummaryrefslogtreecommitdiff
path: root/AST.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2023-04-23 16:15:21 +0200
committerTom Smeding <tom@tomsmeding.com>2023-04-23 16:15:21 +0200
commitf43838280ce37c8ce67eda2d36f4021439f0a84c (patch)
tree312d18a829f7fe311ea2a13463600245b2a2d53a /AST.hs
parentb036b1cac1377cdbb9cc57ae6124cd6d6e5775a9 (diff)
Untested minimal viable parser
Diffstat (limited to 'AST.hs')
-rw-r--r--AST.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/AST.hs b/AST.hs
index b9dd3df..a6726ca 100644
--- a/AST.hs
+++ b/AST.hs
@@ -38,6 +38,8 @@ data RHS t
data Expr t
= ELit t Literal
+ | EVar t Name
+ | ECon t Name
| EList t [Expr t]
| ETup t [Expr t]
| EApp t (Expr t) [Expr t]
@@ -47,7 +49,7 @@ data Expr t
| ELet t [FunDef t] (Expr t)
deriving (Show)
-data Literal = LInt Int | LFloat Double | LChar Char | LString String
+data Literal = LInt Integer | LFloat Rational | LChar Char | LString String
deriving (Show)
data Operator = OAdd | OSub | OMul | ODiv | OMod | OEqu | OPow