From: Vlad Grecescu Date: Thu, 9 Jul 2009 11:07:37 +0000 (+0100) Subject: Write constructors with --dump-tree X-Git-Tag: 0.7.5~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa1e00a99883aa66b9ed06a4d25e628a8d17a0f4;p=thirdparty%2Fvala.git Write constructors with --dump-tree Fixes bug 581663. --- diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index b924c84f1..073c1073a 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -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;