aboutsummaryrefslogtreecommitdiff
path: root/ast/CC/Source.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-23 20:16:39 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-23 20:16:39 +0200
commita9134688a2132c8f9abfff206f6e30614bb9aeff (patch)
tree7f5366329beb1857aa0a1d58781e830fd13ed7a8 /ast/CC/Source.hs
parent39ea4ac3a4b7663882a83f2ada43c8238f087d9b (diff)
WIP lambdas
Diffstat (limited to 'ast/CC/Source.hs')
-rw-r--r--ast/CC/Source.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/ast/CC/Source.hs b/ast/CC/Source.hs
index 81e691b..080b850 100644
--- a/ast/CC/Source.hs
+++ b/ast/CC/Source.hs
@@ -20,9 +20,11 @@ data Type = TFun Type Type
| TInt
deriving (Show, Read)
-data Expr = Call SourceRange Expr Expr
+data Expr = Lam SourceRange [(Name, SourceRange)] Expr
+ | Call SourceRange Expr Expr
| Int SourceRange Int
| Var SourceRange Name
+ | Annot SourceRange Expr Type
deriving (Show, Read)
instance Pretty Type where
@@ -31,6 +33,8 @@ instance Pretty Type where
precParens p 2 (prettyPrec 3 a ++ " -> " ++ prettyPrec 2 b)
instance HasRange Expr where
+ range (Lam sr _ _) = sr
range (Call sr _ _) = sr
range (Int sr _) = sr
range (Var sr _) = sr
+ range (Annot sr _ _) = sr