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



commit c6a13fa330a11485b3693997b54ad3bc91800f1a
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 d2729283c..d2e4dbd23 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -888,8 +888,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));
                }
@@ -903,6 +901,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 ef2bd1179..fbe176035 100644
--- a/codegen/valaccodedelegatemodule.vala
+++ b/codegen/valaccodedelegatemodule.vala
@@ -121,8 +121,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 ()) {
@@ -131,6 +129,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 c64b410d5..ea3f2e55e 100644
--- a/codegen/valagerrormodule.vala
+++ b/codegen/valagerrormodule.vala
@@ -59,8 +59,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));
                }
@@ -74,6 +72,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]