From a9134688a2132c8f9abfff206f6e30614bb9aeff Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 23 Jul 2020 20:16:39 +0200 Subject: WIP lambdas --- ast/CC/Source.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ast/CC/Source.hs') 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 -- cgit v1.2.3-54-g00ecf