]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Drop MethodBindingType
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 16 Sep 2018 14:38:11 +0000 (16:38 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 25 Nov 2018 10:03:57 +0000 (11:03 +0100)
libvaladoc/Makefile.am
libvaladoc/api/method.vala
libvaladoc/api/methodbindingtype.vala [deleted file]
valadoc/treebuilder.vala

index 640e98c8019ee8d315d9d6f09b65d144714074bd..29386d473b5b3858ec51b7b8dba1029230fafbe5 100644 (file)
@@ -72,7 +72,6 @@ libvaladoc_la_VALASOURCES = \
        api/interface.vala \
        api/item.vala \
        api/method.vala \
-       api/methodbindingtype.vala \
        api/namespace.vala \
        api/node.vala \
        api/nodetype.vala \
index a1aaa4870f9c0e5e5c2e43b57675f90602f957df..11d2372b5d141c7a1b8e0b5be5dfa89a074f0a58 100644 (file)
@@ -32,8 +32,6 @@ public class Valadoc.Api.Method : Symbol, Callable {
        private string? dbus_name;
        private string? cname;
 
-       private MethodBindingType binding_type;
-
        /**
         * {@inheritDoc}
         */
@@ -45,7 +43,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
 
        public Method (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
                                   SourceComment? comment, string? cname, string? dbus_name, string? dbus_result_name,
-                                  string? finish_function_cname, MethodBindingType binding_type, bool is_yields,
+                                  string? finish_function_cname, bool is_yields,
                                   bool is_dbus_visible, bool is_constructor, Vala.Method data)
        {
                base (parent, file, name, accessibility, comment, data);
@@ -55,7 +53,6 @@ public class Valadoc.Api.Method : Symbol, Callable {
                this.dbus_name = dbus_name;
                this.cname = cname;
 
-               this.binding_type = binding_type;
                this.is_dbus_visible = is_dbus_visible;
                this.is_constructor = is_constructor;
                this.is_yields = is_yields;
@@ -115,7 +112,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
         */
        public bool is_abstract {
                get {
-                       return binding_type == MethodBindingType.ABSTRACT;
+                       return ((Vala.Method) data).is_abstract;
                }
        }
 
@@ -124,7 +121,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
         */
        public bool is_virtual {
                get {
-                       return binding_type == MethodBindingType.VIRTUAL;
+                       return ((Vala.Method) data).is_virtual;
                }
        }
 
@@ -133,7 +130,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
         */
        public bool is_override {
                get {
-                       return binding_type == MethodBindingType.OVERRIDE;
+                       return ((Vala.Method) data).overrides;
                }
        }
 
@@ -142,7 +139,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
         */
        public bool is_static {
                get {
-                       return !is_constructor && binding_type == MethodBindingType.STATIC
+                       return !is_constructor && ((Vala.Method) data).binding == Vala.MemberBinding.STATIC
                                && parent is Namespace == false;
                }
        }
@@ -160,7 +157,7 @@ public class Valadoc.Api.Method : Symbol, Callable {
         */
        public bool is_inline {
                get {
-                       return binding_type == MethodBindingType.INLINE;
+                       return ((Vala.Method) data).is_inline;
                }
        }
 
diff --git a/libvaladoc/api/methodbindingtype.vala b/libvaladoc/api/methodbindingtype.vala
deleted file mode 100644 (file)
index 0e1df79..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* methodbindingtype.vala
- *
- * Copyright (C) 2011 Florian Brosch
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- *
- * Author:
- *     Brosch Florian <flo.brosch@gmail.com>
- */
-
-
-public enum Valadoc.MethodBindingType {
-       UNMODIFIED,
-       OVERRIDE,
-       ABSTRACT,
-       VIRTUAL,
-       INLINE,
-       STATIC;
-
-       public unowned string to_string () {
-               switch (this) {
-               case OVERRIDE:
-                       return "override";
-
-               case ABSTRACT:
-                       return "abstract";
-
-               case VIRTUAL:
-                       return "virtual";
-
-               case INLINE:
-                       return "inline";
-
-               case STATIC:
-                       return "static";
-
-               case UNMODIFIED:
-                       return "";
-               }
-
-               assert_not_reached ();
-       }
-}
index 5c26ab9208db2a1de8eb5290de738429a477a186..40cffb474508741aabd8e9ef4fce0a729c54bd2a 100644 (file)
@@ -558,23 +558,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                return meta_data.get_namespace ((Vala.Namespace) namespace_symbol, file);
        }
 
-       private MethodBindingType get_method_binding_type (Vala.Method element) {
-               if (element.is_inline) {
-                       return MethodBindingType.INLINE;
-               } else if (element.is_abstract) {
-                       return MethodBindingType.ABSTRACT;
-               } else if (element.is_virtual) {
-                       return MethodBindingType.VIRTUAL;
-               } else if (element.overrides) {
-                       return MethodBindingType.OVERRIDE;
-               } else if (element.is_inline) {
-                       return MethodBindingType.INLINE;
-               } else if (element.binding != Vala.MemberBinding.INSTANCE) {
-                       return MethodBindingType.STATIC;
-               }
-               return MethodBindingType.UNMODIFIED;
-       }
-
        private PropertyAccessorType get_property_accessor_type (Vala.PropertyAccessor element) {
                if (element.construction) {
                        if (element.writable) {
@@ -1180,7 +1163,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                                                                  Vala.GDBusModule.get_dbus_name_for_member (element),
                                                                  Vala.GDBusModule.dbus_result_name (element),
                                                                  (element.coroutine)? get_finish_name (element) : null,
-                                                                 get_method_binding_type (element),
                                                                  element.coroutine,
                                                                  Vala.GDBusModule.is_dbus_visible (element),
                                                                  element is Vala.CreationMethod,
@@ -1210,7 +1192,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                                                                  Vala.GDBusModule.get_dbus_name_for_member (element),
                                                                  Vala.GDBusModule.dbus_result_name (element),
                                                                  (element.coroutine)? get_finish_name (element) : null,
-                                                                 get_method_binding_type (element),
                                                                  element.coroutine,
                                                                  Vala.GDBusModule.is_dbus_visible (element),
                                                                  element is Vala.CreationMethod,