diff options
Diffstat (limited to 'ast/CC/Source.hs')
-rw-r--r-- | ast/CC/Source.hs | 6 |
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 |