[vala] Fix cast expressions in string templates



commit b880b5827f07696c50d87efec734a97c8d3b60bd
Author: Jürg Billeter <j bitron ch>
Date:   Sat Jan 9 12:52:52 2010 +0100

    Fix cast expressions in string templates
    
    Fixes bug 598659.

 vala/valacodevisitor.vala    |    8 ++++++++
 vala/valasymbolresolver.vala |    4 ++++
 vala/valatemplate.vala       |   10 ++++++++++
 3 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodevisitor.vala b/vala/valacodevisitor.vala
index a6a8f58..7744674 100644
--- a/vala/valacodevisitor.vala
+++ b/vala/valacodevisitor.vala
@@ -469,6 +469,14 @@ public abstract class Vala.CodeVisitor {
 	}
 
 	/**
+	 * Visit operation called for string templates.
+	 *
+	 * @param tmpl a string template
+	 */
+	public virtual void visit_template (Template tmpl) {
+	}
+
+	/**
 	 * Visit operation called for null literals.
 	 *
 	 * @param lit a null literal
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index 6c70dbe..48c0ef5 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -439,6 +439,10 @@ public class Vala.SymbolResolver : CodeVisitor {
 		e.accept_children (this);
 	}
 
+	public override void visit_template (Template tmpl) {
+		tmpl.accept_children (this);
+	}
+
 	public override void visit_member_access (MemberAccess expr) {
 		expr.accept_children (this);
 	}
diff --git a/vala/valatemplate.vala b/vala/valatemplate.vala
index b8f53dc..c22fe38 100644
--- a/vala/valatemplate.vala
+++ b/vala/valatemplate.vala
@@ -27,6 +27,16 @@ public class Vala.Template : Expression {
 	public Template () {
 	}
 
+	public override void accept (CodeVisitor visitor) {
+		visitor.visit_template (this);
+	}
+
+	public override void accept_children (CodeVisitor visitor) {
+		foreach (var expr in expression_list) {
+			expr.accept (visitor);
+		}
+	}
+
 	public void add_expression (Expression expr) {
 		expression_list.add (expr);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]