From: Rico Tzschichholz Date: Tue, 12 Jun 2018 10:46:48 +0000 (+0200) Subject: libvaladoc: Replace FormalParameterType with Vala.ParameterDirection X-Git-Tag: 0.43.1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b2b429734b61d5ef185204e0a11f0abdad2bdeb;p=thirdparty%2Fvala.git libvaladoc: Replace FormalParameterType with Vala.ParameterDirection --- diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am index f3f790e76..c35ebfc3e 100644 --- a/libvaladoc/Makefile.am +++ b/libvaladoc/Makefile.am @@ -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 \ diff --git a/libvaladoc/api/formalparameter.vala b/libvaladoc/api/formalparameter.vala index 6bbbc37df..6b572b211 100644 --- a/libvaladoc/api/formalparameter.vala +++ b/libvaladoc/api/formalparameter.vala @@ -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 index 53dcb4fad..000000000 --- a/libvaladoc/api/formalparametertype.vala +++ /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 - */ - -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 (); - } -} - diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala index 7c35905dc..003a61027 100644 --- a/valadoc/treebuilder.vala +++ b/valadoc/treebuilder.vala @@ -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);