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



commit 67b98ff0419cd5b06744da49e4577539fe6636fa
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 dcf5b916c..012c78081 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 b682081f7..35d5c4342 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 d7bbf0c71..d54f0d9d1 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.type_symbol));


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