Skip to content

Commit

Permalink
Added C AST node for arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasC committed Feb 4, 2015
1 parent 3fd16d0 commit bf45a13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/back/CCode/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/back/CCode/PrettyCCode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bf45a13

Please sign in to comment.