[vala/staging] valadoc: Rename FormalParameter to Parameter



commit 513faa82a511372a25f508ead71722a21dd11cc5
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Oct 18 08:33:43 2019 +0200

    valadoc: Rename FormalParameter to Parameter

 libvaladoc/Makefile.am                             |  2 +-
 .../api/{formalparameter.vala => parameter.vala}   |  8 +--
 libvaladoc/api/visitor.vala                        |  6 +-
 libvaladoc/documentation/importerhelper.vala       |  8 +--
 libvaladoc/gtkdocrenderer.vala                     |  8 +--
 libvaladoc/importer/girdocumentationimporter.vala  | 12 ++--
 libvaladoc/taglets/tagletparam.vala                |  4 +-
 valadoc/doclets/gtkdoc/generator.vala              |  2 +-
 valadoc/doclets/gtkdoc/utils.vala                  |  8 +--
 valadoc/symbolresolver.vala                        |  2 +-
 valadoc/tests/drivers/generic-api-test.vala        | 84 +++++++++++-----------
 valadoc/treebuilder.vala                           | 14 ++--
 12 files changed, 79 insertions(+), 79 deletions(-)
---
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index 8a3924b54..b3cf7e5a3 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -67,7 +67,6 @@ libvaladoc_la_VALASOURCES = \
        api/errorcode.vala \
        api/errordomain.vala \
        api/field.vala \
-       api/formalparameter.vala \
        api/interface.vala \
        api/item.vala \
        api/method.vala \
@@ -76,6 +75,7 @@ libvaladoc_la_VALASOURCES = \
        api/nodetype.vala \
        api/ownership.vala \
        api/package.vala \
+       api/parameter.vala \
        api/pointer.vala \
        api/property.vala \
        api/propertyaccessor.vala \
diff --git a/libvaladoc/api/formalparameter.vala b/libvaladoc/api/parameter.vala
similarity index 90%
rename from libvaladoc/api/formalparameter.vala
rename to libvaladoc/api/parameter.vala
index 0014f120b..8ae6b133a 100644
--- a/libvaladoc/api/formalparameter.vala
+++ b/libvaladoc/api/parameter.vala
@@ -1,4 +1,4 @@
-/* formalparameter.vala
+/* parameter.vala
  *
  * Copyright (C) 2008-2011  Florian Brosch
  *
@@ -24,9 +24,9 @@
 using Valadoc.Content;
 
 /**
- * Represents a formal parameter in method, signal and delegate signatures.
+ * Represents a parameter in method, signal and delegate signatures.
  */
-public class Valadoc.Api.FormalParameter : Symbol {
+public class Valadoc.Api.Parameter : Symbol {
        public Content.Run default_value {
                get;
                set;
@@ -58,7 +58,7 @@ public class Valadoc.Api.FormalParameter : Symbol {
 
        private Vala.ParameterDirection type;
 
-       public FormalParameter (Node parent, SourceFile file, string? name, Vala.SymbolAccessibility 
accessibility, Vala.ParameterDirection type, bool ellipsis, Vala.Parameter data) {
+       public Parameter (Node parent, SourceFile file, string? name, Vala.SymbolAccessibility accessibility, 
Vala.ParameterDirection type, bool ellipsis, Vala.Parameter data) {
                base (parent, file, name, accessibility, null, data);
                assert ((name == null && ellipsis) || (name != null && !ellipsis));
 
diff --git a/libvaladoc/api/visitor.vala b/libvaladoc/api/visitor.vala
index bf66a456b..71155bd96 100644
--- a/libvaladoc/api/visitor.vala
+++ b/libvaladoc/api/visitor.vala
@@ -130,11 +130,11 @@ public abstract class Valadoc.Api.Visitor : GLib.Object {
        }
 
        /**
-        * Visit operation called for formal parameters.
+        * Visit operation called for parameters.
         *
-        * @param item a formal parameter
+        * @param item a parameter
         */
-       public virtual void visit_formal_parameter (FormalParameter item) {
+       public virtual void visit_formal_parameter (Parameter item) {
        }
 
        /**
diff --git a/libvaladoc/documentation/importerhelper.vala b/libvaladoc/documentation/importerhelper.vala
index 952db70e5..98100d308 100644
--- a/libvaladoc/documentation/importerhelper.vala
+++ b/libvaladoc/documentation/importerhelper.vala
@@ -36,15 +36,15 @@ namespace Valadoc.ImporterHelper {
                is_return_type_len = false;
                param_array_name = null;
 
-               Api.FormalParameter? param = null; // type parameter or formal parameter
+               Api.Parameter? param = null; // type parameter or formal parameter
                foreach (Api.Node node in element.get_children_by_type (Api.NodeType.FORMAL_PARAMETER, 
false)) {
                        if (node.name == parts[0]) {
-                               param = node as Api.FormalParameter;
+                               param = node as Api.Parameter;
                                break;
                        }
 
-                       if (((Api.FormalParameter) node).implicit_array_length_cparameter_name == parts[0]) {
-                               param_array_name = ((Api.FormalParameter) node).name;
+                       if (((Api.Parameter) node).implicit_array_length_cparameter_name == parts[0]) {
+                               param_array_name = ((Api.Parameter) node).name;
                                break;
                        }
                }
diff --git a/libvaladoc/gtkdocrenderer.vala b/libvaladoc/gtkdocrenderer.vala
index f1197eda1..e76704e85 100644
--- a/libvaladoc/gtkdocrenderer.vala
+++ b/libvaladoc/gtkdocrenderer.vala
@@ -31,8 +31,8 @@ public class Valadoc.GtkdocRenderer : ContentRenderer {
        private string? get_cname (Api.Item item) {
                if (item is Api.Method) {
                        return ((Api.Method)item).get_cname ();
-               } else if (item is Api.FormalParameter) {
-                       return ((Api.FormalParameter)item).name;
+               } else if (item is Api.Parameter) {
+                       return ((Api.Parameter)item).name;
                } else if (item is Api.Constant) {
                        return ((Api.Constant)item).get_cname ();
                } else if (item is Api.Property) {
@@ -68,9 +68,9 @@ public class Valadoc.GtkdocRenderer : ContentRenderer {
                        writer.start_tag ("function")
                                .text (((Api.Method)item).get_cname ())
                                .end_tag ("function");
-               } else if (item is Api.FormalParameter) {
+               } else if (item is Api.Parameter) {
                        writer.start_tag ("parameter").
-                               text (((Api.FormalParameter)item).name ?? "...")
+                               text (((Api.Parameter)item).name ?? "...")
                                .end_tag ("parameter");
                } else if (item is Api.Constant) {
                        writer.start_tag ("constant").text (((Api.Constant)item)
diff --git a/libvaladoc/importer/girdocumentationimporter.vala 
b/libvaladoc/importer/girdocumentationimporter.vala
index 5d72f4414..57c87bb7d 100644
--- a/libvaladoc/importer/girdocumentationimporter.vala
+++ b/libvaladoc/importer/girdocumentationimporter.vala
@@ -79,11 +79,11 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
                file = null;
        }
 
-       private Api.FormalParameter? find_parameter (Api.Node node, string name) {
+       private Api.Parameter? find_parameter (Api.Node node, string name) {
                Vala.List<Api.Node> parameters = node.get_children_by_type (Api.NodeType.FORMAL_PARAMETER, 
false);
                foreach (Api.Node param in parameters) {
-                       if (((Api.FormalParameter) param).name == name) {
-                               return (Api.FormalParameter) param;
+                       if (((Api.Parameter) param).name == name) {
+                               return (Api.Parameter) param;
                        }
                }
 
@@ -117,7 +117,7 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
 
                if (param_names != null) {
                        foreach (ImplicitParameterPos pos in destroy_notifies) {
-                               Api.FormalParameter? param = find_parameter (node, 
param_names[pos.parameter]);
+                               Api.Parameter? param = find_parameter (node, param_names[pos.parameter]);
                                if (param == null) {
                                        continue ;
                                }
@@ -127,7 +127,7 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
                        }
 
                        foreach (ImplicitParameterPos pos in closures) {
-                               Api.FormalParameter? param = find_parameter (node, 
param_names[pos.parameter]);
+                               Api.Parameter? param = find_parameter (node, param_names[pos.parameter]);
                                if (param == null) {
                                        continue ;
                                }
@@ -137,7 +137,7 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
                        }
 
                        foreach (ImplicitParameterPos pos in array_lengths) {
-                               Api.FormalParameter? param = find_parameter (node, 
param_names[pos.parameter]);
+                               Api.Parameter? param = find_parameter (node, param_names[pos.parameter]);
                                if (param == null) {
                                        continue ;
                                }
diff --git a/libvaladoc/taglets/tagletparam.vala b/libvaladoc/taglets/tagletparam.vala
index 274669100..963f96dd0 100644
--- a/libvaladoc/taglets/tagletparam.vala
+++ b/libvaladoc/taglets/tagletparam.vala
@@ -69,7 +69,7 @@ public class Valadoc.Taglets.Param : BlockContent, Taglet, Block {
                } else if (parameter_name == "...") {
                        Vala.List<Api.Node> params = container.get_children_by_type 
(Api.NodeType.FORMAL_PARAMETER, false);
                        foreach (Api.Node param in params) {
-                               if (((Api.FormalParameter) param).ellipsis) {
+                               if (((Api.Parameter) param).ellipsis) {
                                        this.parameter = (Api.Symbol) param;
                                        this.position = (has_instance)? params.size : params.size - 1;
                                        break;
@@ -88,7 +88,7 @@ public class Valadoc.Taglets.Param : BlockContent, Taglet, Block {
                                        break;
                                }
 
-                               Api.FormalParameter formalparam = param as Api.FormalParameter;
+                               Api.Parameter formalparam = param as Api.Parameter;
                                if (formalparam != null && (formalparam.implicit_array_length_cparameter_name 
== parameter_name
                                        || formalparam.implicit_closure_cparameter_name == parameter_name
                                        || formalparam.implicit_destroy_cparameter_name == parameter_name))
diff --git a/valadoc/doclets/gtkdoc/generator.vala b/valadoc/doclets/gtkdoc/generator.vala
index 5be0b746f..365865d71 100644
--- a/valadoc/doclets/gtkdoc/generator.vala
+++ b/valadoc/doclets/gtkdoc/generator.vala
@@ -1245,7 +1245,7 @@ It is important that your <link linkend="GValue"><type>GValue</type></link> hold
                }
        }
 
-       public override void visit_formal_parameter (Api.FormalParameter param) {
+       public override void visit_formal_parameter (Api.Parameter param) {
                var param_name = param.name ?? "...";
                var annotations = new string[]{};
                var direction = "in";
diff --git a/valadoc/doclets/gtkdoc/utils.vala b/valadoc/doclets/gtkdoc/utils.vala
index 21ddea664..33595bc2e 100644
--- a/valadoc/doclets/gtkdoc/utils.vala
+++ b/valadoc/doclets/gtkdoc/utils.vala
@@ -37,8 +37,8 @@ namespace Gtkdoc {
        public string? get_cname (Api.Item item) {
                if (item is Api.Method) {
                        return ((Api.Method)item).get_cname ();
-               } else if (item is Api.FormalParameter) {
-                       return ((Api.FormalParameter)item).name;
+               } else if (item is Api.Parameter) {
+                       return ((Api.Parameter)item).name;
                } else if (item is Api.Constant) {
                        return ((Api.Constant)item).get_cname ();
                } else if (item is Api.Property) {
@@ -132,8 +132,8 @@ namespace Gtkdoc {
                        }
                        return """<link linkend="%s%s"><function>%s()</function></link>"""
                                .printf (to_docbook_id (parent), to_docbook_id (name), name);
-               } else if (item is Api.FormalParameter) {
-                       return "<parameter>%s</parameter>".printf (((Api.FormalParameter)item).name);
+               } else if (item is Api.Parameter) {
+                       return "<parameter>%s</parameter>".printf (((Api.Parameter)item).name);
                } else if (item is Api.Constant) {
                        var cname = ((Api.Constant)item).get_cname ();
                        return """<link linkend="%s:CAPS"><literal>%s</literal></link>"""
diff --git a/valadoc/symbolresolver.vala b/valadoc/symbolresolver.vala
index a297c5e02..94b2bc460 100644
--- a/valadoc/symbolresolver.vala
+++ b/valadoc/symbolresolver.vala
@@ -267,7 +267,7 @@ public class Valadoc.SymbolResolver : Visitor {
        /**
         * {@inheritDoc}
         */
-       public override void visit_formal_parameter (FormalParameter item) {
+       public override void visit_formal_parameter (Api.Parameter item) {
                if (item.ellipsis) {
                        return;
                }
diff --git a/valadoc/tests/drivers/generic-api-test.vala b/valadoc/tests/drivers/generic-api-test.vala
index 369076dd7..ced2bb6e6 100644
--- a/valadoc/tests/drivers/generic-api-test.vala
+++ b/valadoc/tests/drivers/generic-api-test.vala
@@ -1596,9 +1596,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_2":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1631,9 +1631,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_3":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == true);
@@ -1666,9 +1666,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_3a":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == true);
@@ -1701,9 +1701,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_4":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == true);
                        assert (param.is_ref == false);
@@ -1736,9 +1736,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_4a":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == true);
                        assert (param.is_ref == false);
@@ -1771,9 +1771,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_5":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1806,9 +1806,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_6":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1841,9 +1841,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_7":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1868,9 +1868,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_8":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value != null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1903,9 +1903,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_9":
                        assert (params.size == 7);
 
-                       Api.FormalParameter? param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter? param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -1934,9 +1934,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (1) as Api.FormalParameter;
+                       param = params.get (1) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == true);
@@ -1965,9 +1965,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (2) as Api.FormalParameter;
+                       param = params.get (2) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == true);
                        assert (param.is_ref == false);
@@ -1996,9 +1996,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (3) as Api.FormalParameter;
+                       param = params.get (3) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2027,9 +2027,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (4) as Api.FormalParameter;
+                       param = params.get (4) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2058,9 +2058,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (5) as Api.FormalParameter;
+                       param = params.get (5) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value != null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2089,9 +2089,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
 
 
 
-                       param = params.get (6) as Api.FormalParameter;
+                       param = params.get (6) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2116,9 +2116,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_10":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2153,9 +2153,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_11":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2191,9 +2191,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_12":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2229,9 +2229,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_13":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
@@ -2267,9 +2267,9 @@ public static void param_test (Api.Namespace ns, Api.Package pkg) {
                case "test_function_param_14":
                        assert (params.size == 1);
 
-                       Api.FormalParameter param = params.get (0) as Api.FormalParameter;
+                       Api.Parameter param = params.get (0) as Api.Parameter;
                        assert (param != null);
-                       // (.FormalParameter)
+                       // (.Parameter)
                        assert (param.default_value == null);
                        assert (param.is_out == false);
                        assert (param.is_ref == false);
diff --git a/valadoc/treebuilder.vala b/valadoc/treebuilder.vala
index a8f1d6263..ed6dced10 100644
--- a/valadoc/treebuilder.vala
+++ b/valadoc/treebuilder.vala
@@ -962,13 +962,13 @@ public class Valadoc.TreeBuilder : Vala.CodeVisitor {
                Api.Node parent = get_parent_node_for (element);
                SourceFile? file = get_source_file (element);
 
-               FormalParameter node = new FormalParameter (parent,
-                                                                                                       file,
-                                                                                                       
element.name,
-                                                                                                       
element.access,
-                                                                                                       
element.direction,
-                                                                                                       
element.ellipsis,
-                                                                                                       
element);
+               Api.Parameter node = new Api.Parameter (parent,
+                                                                                               file,
+                                                                                               element.name,
+                                                                                               
element.access,
+                                                                                               
element.direction,
+                                                                                               
element.ellipsis,
+                                                                                               element);
                node.parameter_type = create_type_reference (element.variable_type, node, node);
                parent.add_child (node);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]