diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-09-02 10:18:40 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-09-02 10:18:40 +0200 |
commit | 35b17357b5b55e73c6bbc59e7dae094412b7b02a (patch) | |
tree | e3c9aa9d884a4a1c485df6f2494aca103f0351f5 /AST.hs | |
parent | 2a54765a590e1d393442262002885adcbfe156cd (diff) |
Fully support structs
Diffstat (limited to 'AST.hs')
-rw-r--r-- | AST.hs | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -42,7 +42,7 @@ data Statement data AsExpression = AEVar Name (Maybe Type) | AESubscript AsExpression Expression (Maybe Type) - -- | AESet + | AEGet AsExpression Name (Maybe Type) deriving (Show, Eq) data Expression @@ -206,10 +206,16 @@ instance Pretty Expression where instance Pretty AsExpression where prettyI i (AEVar n (Just t)) = "(" ++ prettyI i (AEVar n Nothing) ++ " :: " ++ prettyI i t ++ ")" - prettyI _ (AEVar n Nothing) = n + prettyI _ (AEVar n Nothing) = + n prettyI i (AESubscript ae e (Just t)) = "(" ++ prettyI i (AESubscript ae e Nothing) ++ " :: " ++ prettyI i t ++ ")" - prettyI i (AESubscript ae e Nothing) = prettyI i ae ++ "[" ++ prettyI i e ++ "]" + prettyI i (AESubscript ae e Nothing) = + prettyI i ae ++ "[" ++ prettyI i e ++ "]" + prettyI i (AEGet ae n (Just t)) = + "(" ++ prettyI i (AEGet ae n Nothing) ++ " :: " ++ prettyI i t ++ ")" + prettyI i (AEGet ae n Nothing) = + prettyI i ae ++ "." ++ n instance Pretty BinaryOp where prettyI _ BOAdd = "+" |