From f66874f1f5066e57ef5761cd7c87b5d498fd89b6 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 2 Sep 2022 12:57:29 +0100 Subject: Private variables --- src/Ast.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Ast.hs') diff --git a/src/Ast.hs b/src/Ast.hs index af87a8b..075b9f8 100644 --- a/src/Ast.hs +++ b/src/Ast.hs @@ -17,14 +17,15 @@ instance Show Type where showList :: [Type] -> String showList xs = intercalate ", " $ fmap show xs -type FuncParam = (Ident, Type, SourcePos) +type FuncParam = (Ident, Type, Bool, SourcePos) data Expr = Num Integer SourcePos | Bool' Bool SourcePos | BinOp Op Expr Expr | Variable Ident SourcePos - | Var Ident Type Expr SourcePos + | -- v type value private pos + Var Ident Type Expr Bool SourcePos | -- fn [params] return body private anomyous pos Func Ident [FuncParam] (Maybe Type) [Expr] Bool Bool SourcePos | Call Expr [Expr] SourcePos @@ -41,4 +42,4 @@ data Op toFuncType :: [FuncParam] -> Maybe Type -> Type toFuncType params rtyp = - FuncType (map (\(_, t, _) -> t) params) rtyp + FuncType (map (\(_, t, _, _) -> t) params) rtyp -- cgit v1.2.3