summaryrefslogtreecommitdiff
path: root/vala/valaforstatement.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2008-02-05 15:12:10 +0000
committerJürg Billeter <juergbi@src.gnome.org>2008-02-05 15:12:10 +0000
commit4b4479fbecae1601c138ae1365a4771a2055e5b5 (patch)
tree06c1c7a2d8e99876c1f118fce2a99cc1bb5a1b78 /vala/valaforstatement.vala
parente099f48de2e9ef1b9bef3eb42ea7fea01ad80adc (diff)
downloadvala-4b4479fbecae1601c138ae1365a4771a2055e5b5.tar.gz
support for statements without condition, fixes bug 514548
2008-02-05 Juerg Billeter <j@bitron.ch> * vala/valacfgbuilder.vala, vala/valaforstatement.vala, vala/valasemanticanalyzer.vala, gobject/valaccodegenerator.vala: support for statements without condition, fixes bug 514548 svn path=/trunk/; revision=972
Diffstat (limited to 'vala/valaforstatement.vala')
-rw-r--r--vala/valaforstatement.vala14
1 files changed, 9 insertions, 5 deletions
diff --git a/vala/valaforstatement.vala b/vala/valaforstatement.vala
index 68676e0d1..245b5140f 100644
--- a/vala/valaforstatement.vala
+++ b/vala/valaforstatement.vala
@@ -30,13 +30,15 @@ public class Vala.ForStatement : CodeNode, Statement {
/**
* Specifies the loop condition.
*/
- public Expression! condition {
+ public Expression? condition {
get {
return _condition;
}
set construct {
_condition = value;
- _condition.parent_node = this;
+ if (_condition != null) {
+ _condition.parent_node = this;
+ }
}
}
@@ -118,9 +120,11 @@ public class Vala.ForStatement : CodeNode, Statement {
visitor.visit_end_full_expression (init_expr);
}
- condition.accept (visitor);
-
- visitor.visit_end_full_expression (condition);
+ if (condition != null) {
+ condition.accept (visitor);
+
+ visitor.visit_end_full_expression (condition);
+ }
foreach (Expression it_expr in iterator) {
it_expr.accept (visitor);