summaryrefslogtreecommitdiff
path: root/vala/valatrystatement.vala
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2007-07-12 08:40:09 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-07-12 08:40:09 +0000
commit08c26be77925decc823335d92bf601841bf9f5a0 (patch)
tree5dc6780e51f63e28e0599a8c412436d79df31c0f /vala/valatrystatement.vala
parent85a9aab74baad138f7cf7908cdcd1621489ad5dd (diff)
downloadvala-08c26be77925decc823335d92bf601841bf9f5a0.tar.gz
implement simple exception handling for expression and declaration
2007-07-12 Juerg Billeter <j@bitron.ch> * vala/parser.y, vala/valacodenode.vala, vala/valaenum.vala, vala/valaexpression.vala, vala/valamethod.vala, vala/valasemanticanalyzer.vala, vala/valatrystatement.vala, ccode/valaccodegotostatement.vala, ccode/valaccodelabel.vala: * gobject/valacodegenerator.vala, gobject/valacodegeneratorinvocationexpression.vala, gobject/valacodegeneratormethod.vala: implement simple exception handling for expression and declaration statements * tests/test-033.vala, tests/test-033.out: test exception handling * README, ccode/Makefile.am, tests/Makefile.am: update svn path=/trunk/; revision=348
Diffstat (limited to 'vala/valatrystatement.vala')
-rw-r--r--vala/valatrystatement.vala19
1 files changed, 17 insertions, 2 deletions
diff --git a/vala/valatrystatement.vala b/vala/valatrystatement.vala
index b1a1ccf81..45b316566 100644
--- a/vala/valatrystatement.vala
+++ b/vala/valatrystatement.vala
@@ -48,7 +48,7 @@ public class Vala.TryStatement : Statement {
*/
public TryStatement (construct Block! body, construct Block finally_body, construct SourceReference source_reference = null) {
}
-
+
/**
* Appends the specified clause to the list of catch clauses.
*
@@ -57,10 +57,25 @@ public class Vala.TryStatement : Statement {
public void add_catch_clause (CatchClause! clause) {
catch_clauses.append (clause);
}
-
+
+ /**
+ * Returns a copy of the list of catch clauses.
+ *
+ * @return list of catch clauses
+ */
+ public List<weak CatchClause> get_catch_clauses () {
+ return catch_clauses.copy ();
+ }
+
public override void accept (CodeVisitor! visitor) {
visitor.visit_begin_try_statement (this);
+ body.accept (visitor);
+
+ foreach (CatchClause clause in catch_clauses) {
+ clause.accept (visitor);
+ }
+
visitor.visit_end_try_statement (this);
}
}