aboutsummaryrefslogtreecommitdiff
path: root/src/Ast.hs
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-09-02 12:57:29 +0100
committerJuan J. Martinez <jjm@usebox.net>2022-09-02 12:57:29 +0100
commitf66874f1f5066e57ef5761cd7c87b5d498fd89b6 (patch)
tree0edef26cda608a79c92f9c64c847f214ba877f9c /src/Ast.hs
parenta5633563e9bb579ed10cb7d6d43676485c13b1fb (diff)
downloadmicro-lang-hs-f66874f1f5066e57ef5761cd7c87b5d498fd89b6.tar.gz
micro-lang-hs-f66874f1f5066e57ef5761cd7c87b5d498fd89b6.zip
Private variables
Diffstat (limited to 'src/Ast.hs')
-rw-r--r--src/Ast.hs7
1 files changed, 4 insertions, 3 deletions
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