[vala/0.40] codegen: Accept children after generating type specific declarations



commit 797d88fe32d39d9072fbc239b3d3b386adab3d94
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Oct 1 16:21:21 2019 +0200

    codegen: Accept children after generating type specific declarations

 codegen/valaccodebasemodule.vala     | 4 ++--
 codegen/valaccodedelegatemodule.vala | 4 ++--
 codegen/valagerrormodule.vala        | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index b25405616..f4662f973 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -869,8 +869,6 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
        public override void visit_enum (Enum en) {
                push_line (en.source_reference);
 
-               en.accept_children (this);
-
                if (en.comment != null) {
                        cfile.add_type_member_definition (new CCodeComment (en.comment.content));
                }
@@ -884,6 +882,8 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                        generate_enum_declaration (en, internal_header_file);
                }
 
+               en.accept_children (this);
+
                pop_line ();
        }
 
diff --git a/codegen/valaccodedelegatemodule.vala b/codegen/valaccodedelegatemodule.vala
index 34dd49128..bd959b685 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -119,8 +119,6 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
        }
 
        public override void visit_delegate (Delegate d) {
-               d.accept_children (this);
-
                generate_delegate_declaration (d, cfile);
 
                if (!d.is_internal_symbol ()) {
@@ -129,6 +127,8 @@ public class Vala.CCodeDelegateModule : CCodeArrayModule {
                if (!d.is_private_symbol ()) {
                        generate_delegate_declaration (d, internal_header_file);
                }
+
+               d.accept_children (this);
        }
 
        public override string get_delegate_target_cname (string delegate_cname) {
diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala
index d52c66894..d1d6d3393 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -57,8 +57,6 @@ public class Vala.GErrorModule : CCodeDelegateModule {
        }
 
        public override void visit_error_domain (ErrorDomain edomain) {
-               edomain.accept_children (this);
-
                if (edomain.comment != null) {
                        cfile.add_type_definition (new CCodeComment (edomain.comment.content));
                }
@@ -72,6 +70,8 @@ public class Vala.GErrorModule : CCodeDelegateModule {
                        generate_error_domain_declaration (edomain, internal_header_file);
                }
 
+               edomain.accept_children (this);
+
                string quark_fun_name = get_ccode_lower_case_prefix (edomain) + "quark";
 
                var cquark_fun = new CCodeFunction (quark_fun_name, get_ccode_name (gquark_type.data_type));


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