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/valaswitchsection.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/valaswitchsection.vala')
-rw-r--r-- | vala/valaswitchsection.vala | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/vala/valaswitchsection.vala b/vala/valaswitchsection.vala index 2212c47b9..2f38944eb 100644 --- a/vala/valaswitchsection.vala +++ b/vala/valaswitchsection.vala @@ -80,4 +80,31 @@ public class Vala.SwitchSection : Block { st.accept (visitor); } } + + public override bool check (SemanticAnalyzer analyzer) { + if (checked) { + return !error; + } + + checked = true; + + foreach (SwitchLabel label in get_labels ()) { + label.accept (analyzer); + } + + owner = analyzer.current_symbol.scope; + analyzer.current_symbol = this; + + foreach (Statement st in get_statements ()) { + st.accept (analyzer); + } + + foreach (LocalVariable local in get_local_variables ()) { + local.active = false; + } + + analyzer.current_symbol = analyzer.current_symbol.parent_symbol; + + return !error; + } } |