[vala/0.42] genieparser: Use dedicated Class.add_constructor/destructor() methods
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.42] genieparser: Use dedicated Class.add_constructor/destructor() methods
- Date: Mon, 26 Nov 2018 09:13:33 +0000 (UTC)
commit 2ec4df221ef6d887cbef413a89f083a03271e468
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sat Nov 17 13:34:07 2018 +0100
genieparser: Use dedicated Class.add_constructor/destructor() methods
vala/valagenieparser.vala | 38 ++------------------------------------
1 file changed, 2 insertions(+), 36 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 24c638492..b7c681755 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -2745,43 +2745,9 @@ public class Vala.Genie.Parser : CodeVisitor {
} else if (sym is Property) {
cl.add_property ((Property) sym);
} else if (sym is Constructor) {
- var c = (Constructor) sym;
- if (c.binding == MemberBinding.INSTANCE) {
- if (cl.constructor != null) {
- Report.error (c.source_reference, "class already contains a
constructor");
- }
- cl.constructor = c;
- } else if (c.binding == MemberBinding.CLASS) {
- if (cl.class_constructor != null) {
- Report.error (c.source_reference, "class already contains a class
constructor");
- }
- cl.class_constructor = c;
- } else {
- if (cl.static_constructor != null) {
- Report.error (c.source_reference, "class already contains a static
constructor");
- }
- cl.static_constructor = c;
- }
-
+ cl.add_constructor ((Constructor) sym);
} else if (sym is Destructor) {
- var d = (Destructor) sym;
- if (d.binding == MemberBinding.STATIC) {
- if (cl.static_destructor != null) {
- Report.error (d.source_reference, "class already contains a static
destructor");
- }
- cl.static_destructor = (Destructor) d;
- } else if (d.binding == MemberBinding.CLASS) {
- if (cl.class_destructor != null) {
- Report.error (d.source_reference, "class already contains a class
destructor");
- }
- cl.class_destructor = (Destructor) d;
- } else {
- if (cl.destructor != null) {
- Report.error (d.source_reference, "class already contains a
destructor");
- }
- cl.destructor = (Destructor) d;
- }
-
+ cl.add_destructor ((Destructor) sym);
} else {
Report.error (sym.source_reference, "unexpected declaration in class");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]