]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix cast expressions in string templates
authorJürg Billeter <j@bitron.ch>
Sat, 9 Jan 2010 11:52:52 +0000 (12:52 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 9 Jan 2010 11:52:52 +0000 (12:52 +0100)
Fixes bug 598659.

vala/valacodevisitor.vala
vala/valasymbolresolver.vala
vala/valatemplate.vala

index a6a8f58d385ee8e7b29d1456dbefe5afa1493545..7744674d848c9d56df9a94b1bf50b2af4172fb63 100644 (file)
@@ -468,6 +468,14 @@ public abstract class Vala.CodeVisitor {
        public virtual void visit_string_literal (StringLiteral lit) {
        }
 
+       /**
+        * Visit operation called for string templates.
+        *
+        * @param tmpl a string template
+        */
+       public virtual void visit_template (Template tmpl) {
+       }
+
        /**
         * Visit operation called for null literals.
         *
index 6c70dbe66e5d96047cbad3fc53ec2fce71303ea0..48c0ef5fce1782adfede7ff851d624af1e52379f 100644 (file)
@@ -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);
        }
index b8f53dcec8a9aa5334a242b446ba5ccf1991cb99..c22fe389f91afcea716fe47c188b01af776ca050 100644 (file)
@@ -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);
        }