]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Write constructors with --dump-tree
authorVlad Grecescu <b100dian@gmail.com>
Thu, 9 Jul 2009 11:07:37 +0000 (12:07 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 9 Jul 2009 11:08:49 +0000 (12:08 +0100)
Fixes bug 581663.

vala/valacodewriter.vala

index b924c84f12140989cbea8263e2e598bed7015b50..073c1073a2c5447905865a27473929de4e302f2c 100644 (file)
@@ -260,6 +260,10 @@ public class Vala.CodeWriter : CodeVisitor {
                visit_sorted (cl.get_properties ());
                visit_sorted (cl.get_signals ());
 
+               if (cl.constructor != null) {
+                       cl.constructor.accept (this);
+               }
+
                current_scope = current_scope.parent_scope;
 
                write_end_block ();
@@ -787,6 +791,17 @@ public class Vala.CodeWriter : CodeVisitor {
                write_newline ();
        }
 
+       public override void visit_constructor (Constructor c) {
+               if (!dump_tree) {
+                       return;
+               }
+
+               write_indent ();
+               write_string ("construct");
+               write_code_block (c.body);
+               write_newline ();
+       }
+
        public override void visit_method (Method m) {
                if (m.external_package) {
                        return;