Mercurial > projects > dil
diff trunk/src/Statements.d @ 162:c7b250662c74
- Added class ScopeStatement.
- Fix: didn't creat class instance in parseStatements().
- Implemented parseIfStatement().
author | aziz |
---|---|
date | Fri, 13 Jul 2007 22:31:02 +0000 |
parents | 82c5cfc7d6d3 |
children | 8ec99326752b |
line wrap: on
line diff
--- a/trunk/src/Statements.d Fri Jul 13 20:49:01 2007 +0000 +++ b/trunk/src/Statements.d Fri Jul 13 22:31:02 2007 +0000 @@ -3,6 +3,8 @@ License: GPL2 +/ module Statements; +import Expressions; +import Types; class Statement { @@ -18,6 +20,15 @@ } } +class ScopeStatement : Statement +{ + Statement s; + this(Statement s) + { + this.s = s; + } +} + class LabeledStatement : Statement { string label; @@ -41,7 +52,19 @@ class IfStatement : Statement { - + Type type; + string ident; + Expression condition; + Statement ifBody; + Statement elseBody; + this(Type type, string ident, Expression condition, Statement ifBody, Statement elseBody) + { + this.type = type; + this.ident = ident; + this.condition = condition; + this.ifBody = ifBody; + this.elseBody = elseBody; + } } class ConditionalStatement : Statement