summaryrefslogtreecommitdiff
path: root/vala/valastatementlist.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2008-11-29 12:20:30 +0000
committerJürg Billeter <juergbi@src.gnome.org>2008-11-29 12:20:30 +0000
commit9c5443a1041e28145f8b68c0c58d8d73e5857fce (patch)
tree61feab22fcd027cb47a9d85979e572f774422271 /vala/valastatementlist.vala
parentf6f5e2a72a0182734779e15679eed33f763ff833 (diff)
downloadvala-9c5443a1041e28145f8b68c0c58d8d73e5857fce.tar.gz
Convert ternary conditionals into if statements, fixes bug 543870 and bug
2008-11-29 Jürg Billeter <j@bitron.ch> * vala/Makefile.am: * vala/valablock.vala: * vala/valacodenode.vala: * vala/valaconditionalexpression.vala: * vala/valadeclarationstatement.vala: * vala/valaexpression.vala: * vala/valanullchecker.vala: * vala/valastatementlist.vala: * gobject/valaccodebasemodule.vala: * gobject/valaccodegenerator.vala: * gobject/valaccodemodule.vala: Convert ternary conditionals into if statements, fixes bug 543870 and bug 554594 svn path=/trunk/; revision=2083
Diffstat (limited to 'vala/valastatementlist.vala')
-rw-r--r--vala/valastatementlist.vala57
1 files changed, 57 insertions, 0 deletions
diff --git a/vala/valastatementlist.vala b/vala/valastatementlist.vala
new file mode 100644
index 000000000..a653f02e5
--- /dev/null
+++ b/vala/valastatementlist.vala
@@ -0,0 +1,57 @@
+/* valastatementlist.vala
+ *
+ * Copyright (C) 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Author:
+ * Jürg Billeter <j@bitron.ch>
+ */
+
+using Gee;
+
+public class Vala.StatementList : CodeNode, Statement {
+ private Gee.List<Statement> list = new ArrayList<Statement> ();
+
+ public int length {
+ get { return list.size; }
+ }
+
+ public StatementList (SourceReference source_reference) {
+ this.source_reference = source_reference;
+ }
+
+ public Statement get (int index) {
+ return list.get (index);
+ }
+
+ public void set (int index, Statement stmt) {
+ list.set (index, stmt);
+ }
+
+ public void add (Statement stmt) {
+ list.add (stmt);
+ }
+
+ public void insert (int index, Statement stmt) {
+ list.insert (index, stmt);
+ }
+
+ public override void accept (CodeVisitor visitor) {
+ foreach (Statement stmt in list) {
+ stmt.accept (visitor);
+ }
+ }
+}