[vala] Write constructors with --dump-tree



commit fa1e00a99883aa66b9ed06a4d25e628a8d17a0f4
Author: Vlad Grecescu <b100dian gmail com>
Date:   Thu Jul 9 12:07:37 2009 +0100

    Write constructors with --dump-tree
    
    Fixes bug 581663.

 vala/valacodewriter.vala |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index b924c84..073c107 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;



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