Mercurial > projects > dang
comparison sema/AstAction.d @ 149:393a1f47a6d2
For loops in AST and sema. Should have correct scope and such now.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Mon, 21 Jul 2008 21:00:20 +0200 |
parents | 6e6355fb5f0f |
children | ee202c72cd30 |
comparison
equal
deleted
inserted
replaced
148:6ec686d9c87d | 149:393a1f47a6d2 |
---|---|
192 StmtT actOnWhileStmt(ref Token tok, ExprT cond, StmtT whileBody) | 192 StmtT actOnWhileStmt(ref Token tok, ExprT cond, StmtT whileBody) |
193 { | 193 { |
194 Exp c = cast(Exp)cond; | 194 Exp c = cast(Exp)cond; |
195 Stmt b = cast(Stmt)whileBody; | 195 Stmt b = cast(Stmt)whileBody; |
196 return new WhileStmt(c, b); | 196 return new WhileStmt(c, b); |
197 } | |
198 | |
199 StmtT actOnForStmt(ref Token tok, StmtT init, ExprT cond, ExprT incre, StmtT forBody) | |
200 { | |
201 Stmt i = cast(Stmt)init; | |
202 Exp c = cast(Exp)cond; | |
203 Exp inc = cast(Exp)incre; | |
204 Stmt b = cast(Stmt)forBody; | |
205 return new ForStmt(i, c, inc, b); | |
197 } | 206 } |
198 | 207 |
199 StmtT actOnDeclStmt(DeclT decl) | 208 StmtT actOnDeclStmt(DeclT decl) |
200 { | 209 { |
201 Decl d = cast(Decl)decl; | 210 Decl d = cast(Decl)decl; |