diff options
author | Jürg Billeter <j@bitron.ch> | 2008-11-07 11:10:31 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-11-07 11:10:31 +0000 |
commit | 955c4f6c3e8bf120d363015897528567b2df23ed (patch) | |
tree | bfbcfdbf98058f2de5f17491ee63934b98ca8355 /vala/valaexpressionstatement.vala | |
parent | 4ed3719f219f7ee4d3c40544df7ec75719fae8fd (diff) | |
download | vala-955c4f6c3e8bf120d363015897528567b2df23ed.tar.gz |
Move statement checking to code nodes
2008-11-07 Jürg Billeter <j@bitron.ch>
* vala/valablock.vala:
* vala/valacatchclause.vala:
* vala/valadeclarationstatement.vala:
* vala/valadeletestatement.vala:
* vala/valadostatement.vala:
* vala/valaexpressionstatement.vala:
* vala/valaforstatement.vala:
* vala/valaifstatement.vala:
* vala/valainitializerlist.vala:
* vala/valalocalvariable.vala:
* vala/valalockstatement.vala:
* vala/valasemanticanalyzer.vala:
* vala/valaswitchsection.vala:
* vala/valatrystatement.vala:
* vala/valawhilestatement.vala:
Move statement checking to code nodes
svn path=/trunk/; revision=2003
Diffstat (limited to 'vala/valaexpressionstatement.vala')
-rw-r--r-- | vala/valaexpressionstatement.vala | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/vala/valaexpressionstatement.vala b/vala/valaexpressionstatement.vala index e3fb6ecb3..179b8078c 100644 --- a/vala/valaexpressionstatement.vala +++ b/vala/valaexpressionstatement.vala @@ -1,6 +1,6 @@ /* valaexpressionstatement.vala * - * Copyright (C) 2006-2007 Jürg Billeter + * Copyright (C) 2006-2008 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -85,4 +85,22 @@ public class Vala.ExpressionStatement : CodeNode, Statement { return null; } + + public override bool check (SemanticAnalyzer analyzer) { + if (checked) { + return !error; + } + + checked = true; + + if (expression.error) { + // ignore inner error + error = true; + return false; + } + + add_error_types (expression.get_error_types ()); + + return !error; + } } |