]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Accept children after generating type specific declarations
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 1 Oct 2019 14:21:21 +0000 (16:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:45:55 +0000 (13:45 +0200)
codegen/valaccodebasemodule.vala
codegen/valaccodedelegatemodule.vala
codegen/valagerrormodule.vala

index d2729283c818217d2950c4f5daa711d2fe1da348..d2e4dbd233109b53d7fa49e29af8a0204012bfc1 100644 (file)
@@ -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 ();
        }
 
index ef2bd11790871ea62bf489b6d8a86b59b2ca5f21..fbe176035df6a7e5eff2703a335889473f2a295a 100644 (file)
@@ -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) {
index c64b410d5ecdb38b125b5d4733f94d1afc3e55e8..ea3f2e55e26a0486ca728eb4617b1109197fc748 100644 (file)
@@ -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));