diff --git a/src/back/CCode/Main.hs b/src/back/CCode/Main.hs index c5499d7c8..1835b38ae 100644 --- a/src/back/CCode/Main.hs +++ b/src/back/CCode/Main.hs @@ -68,6 +68,7 @@ data CCode a where CUnary :: UsableAs e Expr => CCode Name -> CCode e -> CCode Expr BinOp :: UsableAs e Expr => CCode Name -> CCode e -> CCode e -> CCode Expr Dot :: (UsableAs e Expr) => CCode e -> CCode Name -> CCode Lval + Arrow :: (UsableAs e Expr) => CCode e -> CCode Name -> CCode Lval Deref :: UsableAs e Expr => CCode e -> CCode Expr Cast :: UsableAs e Expr => CCode Ty -> CCode e -> CCode Expr ArrAcc :: Int -> CCode Lval -> CCode Lval diff --git a/src/back/CCode/PrettyCCode.hs b/src/back/CCode/PrettyCCode.hs index de602ff4c..27e73f0d8 100644 --- a/src/back/CCode/PrettyCCode.hs +++ b/src/back/CCode/PrettyCCode.hs @@ -72,6 +72,7 @@ pp' (Parens ccode) = parens $ pp' ccode pp' (CUnary o e) = parens $ pp' o <+> pp' e pp' (BinOp o e1 e2) = parens $ pp' e1 <+> pp' o <+> pp' e2 pp' (Dot ccode id) = pp' ccode <> text "." <> tshow id +pp' (Arrow ccode id) = pp' ccode <> text "->" <> tshow id pp' (Deref ccode) = parens $ star <> pp' ccode pp' (Cast ty e) = parens $ (parens $ pp' ty) <+> pp' e pp' (ArrAcc i l) = parens $ pp' l <> brackets (tshow i)