]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Replace FormalParameterType with Vala.ParameterDirection
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 12 Jun 2018 10:46:48 +0000 (12:46 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 25 Nov 2018 09:23:40 +0000 (10:23 +0100)
libvaladoc/Makefile.am
libvaladoc/api/formalparameter.vala
libvaladoc/api/formalparametertype.vala [deleted file]
valadoc/treebuilder.vala

index f3f790e762b1392dffad91a95c2bdafdb07a3dcf..c35ebfc3ef512e6eb47639f8833fd1c67032cf2f 100644 (file)
@@ -70,7 +70,6 @@ libvaladoc_la_VALASOURCES = \
        api/errordomain.vala \
        api/field.vala \
        api/formalparameter.vala \
-       api/formalparametertype.vala \
        api/interface.vala \
        api/item.vala \
        api/member.vala \
index 6bbbc37df2f764689fee090250554ba2dfcb297e..6b572b211368b1eaac1b34e89465e1cb98acd587 100644 (file)
@@ -56,9 +56,9 @@ public class Valadoc.Api.FormalParameter : Symbol {
                set;
        }
 
-       private FormalParameterType type;
+       private Vala.ParameterDirection type;
 
-       public FormalParameter (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, FormalParameterType type, bool ellipsis, Vala.Parameter data) {
+       public FormalParameter (Node parent, SourceFile file, string? name, SymbolAccessibility accessibility, Vala.ParameterDirection type, bool ellipsis, Vala.Parameter data) {
                base (parent, file, name, accessibility, data);
                assert ((name == null && ellipsis) || (name != null && !ellipsis));
 
@@ -71,7 +71,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
         */
        public bool is_out {
                get {
-                       return type == FormalParameterType.OUT;
+                       return type == Vala.ParameterDirection.OUT;
                }
        }
 
@@ -80,7 +80,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
         */
        public bool is_ref {
                get {
-                       return type == FormalParameterType.REF;
+                       return type == Vala.ParameterDirection.REF;
                }
        }
 
diff --git a/libvaladoc/api/formalparametertype.vala b/libvaladoc/api/formalparametertype.vala
deleted file mode 100644 (file)
index 53dcb4f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/* formalparametertype.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:
- *     Florian Brosch <flo.brosch@gmail.com>
- */
-
-public enum Valadoc.Api.FormalParameterType {
-       IN,
-       OUT,
-       REF;
-
-       public unowned string to_string () {
-               switch (this) {
-               case FormalParameterType.OUT:
-                       return "out";
-
-               case FormalParameterType.REF:
-                       return "ref";
-
-               case FormalParameterType.IN:
-                       return "";
-
-               }
-
-               assert_not_reached ();
-       }
-}
-
index 7c35905dcaa73a5cbc9ebbf408d2302aad1d29a7..003a61027c6d47036264ff78f1b31c71d2f3d677 100644 (file)
@@ -720,18 +720,6 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                return PropertyBindingType.UNMODIFIED;
        }
 
-       private FormalParameterType get_formal_parameter_type (Vala.Parameter element) {
-               if (element.direction == Vala.ParameterDirection.OUT) {
-                       return FormalParameterType.OUT;
-               } else if (element.direction == Vala.ParameterDirection.REF) {
-                       return FormalParameterType.REF;
-               } else if (element.direction == Vala.ParameterDirection.IN) {
-                       return FormalParameterType.IN;
-               }
-
-               error ("Unknown formal parameter type");
-       }
-
 
        //
        // Vala tree creation:
@@ -1453,7 +1441,7 @@ public class Valadoc.Drivers.TreeBuilder : Vala.CodeVisitor {
                                                                                                        file,
                                                                                                        element.name,
                                                                                                        get_access_modifier(element),
-                                                                                                       get_formal_parameter_type (element),
+                                                                                                       element.direction,
                                                                                                        element.ellipsis,
                                                                                                        element);
                node.parameter_type = create_type_reference (element.variable_type, node, node);