From: Simon Werbeck Date: Tue, 27 Mar 2012 22:59:17 +0000 (+0200) Subject: Support 'using' directive with nested namespace in fast-vapi X-Git-Tag: 0.17.4~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3a151024ae01f0d79132313e6b0b98f6ccc6205;p=thirdparty%2Fvala.git Support 'using' directive with nested namespace in fast-vapi Fixes bug 672960. --- diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index f79c2aff2..3986e706f 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -124,7 +124,24 @@ public class Vala.CodeWriter : CodeVisitor { public override void visit_using_directive (UsingDirective ns) { if (type == CodeWriterType.FAST) { - write_string ("using %s;\n".printf (ns.namespace_symbol.name)); + write_string ("using "); + + var symbols = new GLib.List (); + var sym = (UnresolvedSymbol) ns.namespace_symbol; + symbols.prepend (sym); + + while ((sym = sym.inner) != null) { + symbols.prepend (sym); + } + + write_string (symbols.nth_data (0).name); + + for (int i = 1; i < symbols.length (); i++) { + write_string ("."); + write_string (symbols.nth_data (i).name); + } + + write_string (";\n"); } }