summaryrefslogtreecommitdiff
path: root/Language/C.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-10-10 19:55:59 +0200
committerTom Smeding <tom@tomsmeding.com>2021-10-10 19:55:59 +0200
commit1640830bf5dc0630481e698512064215eb3e8249 (patch)
tree229b5666508e1152b5fff77733e48539591af0ab /Language/C.hs
parentff220bfb4c4c67f666a4701f2514d8de432f1e9a (diff)
Diffstat (limited to 'Language/C.hs')
-rw-r--r--Language/C.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Language/C.hs b/Language/C.hs
index 9a65115..8b2a9d5 100644
--- a/Language/C.hs
+++ b/Language/C.hs
@@ -44,6 +44,9 @@ data Stmt
| SCall Name [Expr]
-- | @SFor ty i lo hi body@: @for (ty i = lo; i < hi; i++) body@
| SFor Type Name Expr Expr [Stmt]
+ -- | @SWhile pre cond post@: @while (true) { pre; if (!cond) break; post; }@
+ -- Special case if @pre == []@: @while (cond) { post; }
+ | SWhile [Stmt] Expr [Stmt]
| SIf Expr [Stmt] [Stmt]
deriving (Show, Eq)
@@ -56,6 +59,7 @@ data Expr
| EIndex Name Expr
| EPtrTo Expr
| ESizeOf Type
+ | ECast Type Expr
deriving (Show, Eq)