Commit 7b2b4297 authored by Rico Tzschichholz's avatar Rico Tzschichholz

libvaladoc: Replace FormalParameterType with Vala.ParameterDirection

parent e3e098f4
......@@ -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 \
......
......@@ -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;
}
}
......
/* 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 ();
}
}
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment