[vala/wip/dbusgen: 231/232] vala: Don't force cheader attributes for code-writer in DUMP



commit 5e3f091b5042a0131aec2b171f71237d058ceb4c
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Sep 25 21:09:47 2019 +0200

    vala: Don't force cheader attributes for code-writer in DUMP

 vala/valacodewriter.vala | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 97aa48136..81f638f6b 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -204,7 +204,7 @@ public class Vala.CodeWriter : CodeVisitor {
 
        private string get_cheaders (Symbol sym) {
                string cheaders = "";
-               if (type != CodeWriterType.FAST && !sym.external_package) {
+               if (type != CodeWriterType.FAST && type != CodeWriterType.DUMP && !sym.external_package) {
                        cheaders = sym.get_attribute_string ("CCode", "cheader_filename") ?? "";
                        if (cheaders == "" && sym.parent_symbol != null && sym.parent_symbol != context.root) 
{
                                cheaders = get_cheaders (sym.parent_symbol);
@@ -445,7 +445,7 @@ public class Vala.CodeWriter : CodeVisitor {
                        write_indent ();
                        write_identifier (ev.name);
 
-                       if (type == CodeWriterType.FAST && ev.value != null) {
+                       if ((type == CodeWriterType.FAST || type == CodeWriterType.DUMP) && ev.value != null) 
{
                                write_string(" = ");
                                ev.value.accept (this);
                        }
@@ -557,7 +557,7 @@ public class Vala.CodeWriter : CodeVisitor {
                write_string (" ");
                write_identifier (c.name);
                write_type_suffix (c.type_reference);
-               if (type == CodeWriterType.FAST && c.value != null) {
+               if ((type == CodeWriterType.FAST || type == CodeWriterType.DUMP) && c.value != null) {
                        write_string(" = ");
                        c.value.accept (this);
                }
@@ -1557,7 +1557,7 @@ public class Vala.CodeWriter : CodeVisitor {
        private void write_attributes (CodeNode node) {
                var sym = node as Symbol;
 
-               var need_cheaders = type != CodeWriterType.FAST && sym != null && !(sym is Namespace) && 
sym.parent_symbol is Namespace;
+               var need_cheaders = type != CodeWriterType.FAST && type != CodeWriterType.DUMP && sym != null 
&& !(sym is Namespace) && sym.parent_symbol is Namespace;
 
                var attributes = new GLib.Sequence<Attribute> ();
                foreach (var attr in node.attributes) {


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