[vala/staging: 5/22] libvaladoc: Drop Api.Member



commit 96ccd5bdb1a7bb6375eca90c91111b05cc49afe6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Nov 18 14:35:05 2018 +0100

    libvaladoc: Drop Api.Member

 libvaladoc/Makefile.am               |  1 -
 libvaladoc/api/constant.vala         |  2 +-
 libvaladoc/api/enumvalue.vala        | 30 +----------------
 libvaladoc/api/errorcode.vala        | 30 +----------------
 libvaladoc/api/field.vala            |  2 +-
 libvaladoc/api/formalparameter.vala  |  2 +-
 libvaladoc/api/member.vala           | 62 ------------------------------------
 libvaladoc/api/method.vala           |  2 +-
 libvaladoc/api/namespace.vala        | 34 +-------------------
 libvaladoc/api/property.vala         |  2 +-
 libvaladoc/api/propertyaccessor.vala |  2 +-
 libvaladoc/api/signal.vala           |  2 +-
 libvaladoc/api/symbol.vala           | 30 ++++++++++++++++-
 libvaladoc/api/typeparameter.vala    |  2 +-
 libvaladoc/api/typesymbol.vala       | 30 +----------------
 15 files changed, 41 insertions(+), 192 deletions(-)
---
diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am
index c2f431d9f..640e98c80 100644
--- a/libvaladoc/Makefile.am
+++ b/libvaladoc/Makefile.am
@@ -71,7 +71,6 @@ libvaladoc_la_VALASOURCES = \
        api/formalparameter.vala \
        api/interface.vala \
        api/item.vala \
-       api/member.vala \
        api/method.vala \
        api/methodbindingtype.vala \
        api/namespace.vala \
diff --git a/libvaladoc/api/constant.vala b/libvaladoc/api/constant.vala
index fde36246f..c6c1613fe 100644
--- a/libvaladoc/api/constant.vala
+++ b/libvaladoc/api/constant.vala
@@ -26,7 +26,7 @@ using Valadoc.Content;
 /**
  * Represents a type member with a constant value.
  */
-public class Valadoc.Api.Constant : Member {
+public class Valadoc.Api.Constant : Symbol {
        private string? cname;
 
        /**
diff --git a/libvaladoc/api/enumvalue.vala b/libvaladoc/api/enumvalue.vala
index 55702e1df..c38582329 100644
--- a/libvaladoc/api/enumvalue.vala
+++ b/libvaladoc/api/enumvalue.vala
@@ -27,7 +27,6 @@ using Valadoc.Content;
  * Represents an enum member.
  */
 public class Valadoc.Api.EnumValue: Symbol {
-       private SourceComment? source_comment;
        private string? cname;
 
        public Content.Run default_value {
@@ -45,38 +44,11 @@ public class Valadoc.Api.EnumValue: Symbol {
        }
 
        public EnumValue (Enum parent, SourceFile file, string name, SourceComment? comment, string? cname, 
Vala.EnumValue data) {
-               base (parent, file, name, parent.accessibility, data);
+               base (parent, file, name, parent.accessibility, comment, data);
 
-               this.source_comment = comment;
                this.cname = cname;
        }
 
-       /**
-        * {@inheritDoc}
-        */
-       internal override void parse_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       return ;
-               }
-
-               if (source_comment != null) {
-                       documentation = parser.parse (this, source_comment);
-               }
-
-               base.parse_comments (settings, parser);
-       }
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void check_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       parser.check (this, documentation);
-               }
-
-               base.check_comments (settings, parser);
-       }
-
        /**
         * Returns the name of this enum value as it is used in C.
         */
diff --git a/libvaladoc/api/errorcode.vala b/libvaladoc/api/errorcode.vala
index 64f169357..6994f87a7 100644
--- a/libvaladoc/api/errorcode.vala
+++ b/libvaladoc/api/errorcode.vala
@@ -27,46 +27,18 @@ using Valadoc.Content;
  * Represents an errordomain member in the source code.
  */
 public class Valadoc.Api.ErrorCode : Symbol {
-       private SourceComment? source_comment;
        private string? dbus_name;
        private string? cname;
 
        public ErrorCode (ErrorDomain parent, SourceFile file, string name, SourceComment? comment,
                                          string? cname, string? dbus_name, Vala.ErrorCode data)
        {
-               base (parent, file, name, parent.accessibility, data);
+               base (parent, file, name, parent.accessibility, comment, data);
 
-               this.source_comment = comment;
                this.dbus_name = dbus_name;
                this.cname = cname;
        }
 
-       /**
-        * {@inheritDoc}
-        */
-       internal override void parse_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       return ;
-               }
-
-               if (source_comment != null) {
-                       documentation = parser.parse (this, source_comment);
-               }
-
-               base.parse_comments (settings, parser);
-       }
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void check_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       parser.check (this, documentation);
-               }
-
-               base.check_comments (settings, parser);
-       }
-
        /**
         * Returns the name of this class as it is used in C.
         */
diff --git a/libvaladoc/api/field.vala b/libvaladoc/api/field.vala
index 16264fbc7..f2f086d8d 100644
--- a/libvaladoc/api/field.vala
+++ b/libvaladoc/api/field.vala
@@ -26,7 +26,7 @@ using Valadoc.Content;
 /**
  * Represents a field.
  */
-public class Valadoc.Api.Field : Member {
+public class Valadoc.Api.Field : Symbol {
        private string? cname;
 
        public Field (Node parent, SourceFile file, string name, Vala.SymbolAccessibility accessibility,
diff --git a/libvaladoc/api/formalparameter.vala b/libvaladoc/api/formalparameter.vala
index 4c3bd9e24..0014f120b 100644
--- a/libvaladoc/api/formalparameter.vala
+++ b/libvaladoc/api/formalparameter.vala
@@ -59,7 +59,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) {
-               base (parent, file, name, accessibility, data);
+               base (parent, file, name, accessibility, null, data);
                assert ((name == null && ellipsis) || (name != null && !ellipsis));
 
                this.ellipsis = ellipsis;
diff --git a/libvaladoc/api/method.vala b/libvaladoc/api/method.vala
index 19d6f6442..a1aaa4870 100644
--- a/libvaladoc/api/method.vala
+++ b/libvaladoc/api/method.vala
@@ -26,7 +26,7 @@ using Valadoc.Content;
 /**
  * Represents a function or a method.
  */
-public class Valadoc.Api.Method : Member, Callable {
+public class Valadoc.Api.Method : Symbol, Callable {
        private string? finish_function_cname;
        private string? dbus_result_name;
        private string? dbus_name;
diff --git a/libvaladoc/api/namespace.vala b/libvaladoc/api/namespace.vala
index b925e37bf..04ddbb20c 100644
--- a/libvaladoc/api/namespace.vala
+++ b/libvaladoc/api/namespace.vala
@@ -27,42 +27,10 @@ using Valadoc.Content;
  * Represents a namespace declaration.
  */
 public class Valadoc.Api.Namespace : Symbol {
-       private SourceComment? source_comment;
-
        public Namespace (Api.Node parent, SourceFile file, string? name, SourceComment? comment, 
Vala.Namespace data) {
-               base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, data);
-
-               this.source_comment = comment;
+               base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, comment, data);
        }
 
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void parse_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       return ;
-               }
-
-               if (source_comment != null) {
-                       documentation = parser.parse (this, source_comment);
-               }
-
-               base.parse_comments (settings, parser);
-       }
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void check_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       parser.check (this, documentation);
-               }
-
-               base.check_comments (settings, parser);
-       }
-
-
        /**
         * {@inheritDoc}
         */
diff --git a/libvaladoc/api/property.vala b/libvaladoc/api/property.vala
index 9dd03b5da..a5c8df043 100644
--- a/libvaladoc/api/property.vala
+++ b/libvaladoc/api/property.vala
@@ -26,7 +26,7 @@ using Valadoc.Content;
 /**
  * Represents a property declaration.
  */
-public class Valadoc.Api.Property : Member {
+public class Valadoc.Api.Property : Symbol {
        private PropertyBindingType binding_type;
        private string? dbus_name;
        private string? cname;
diff --git a/libvaladoc/api/propertyaccessor.vala b/libvaladoc/api/propertyaccessor.vala
index c603fae00..55bead0d9 100644
--- a/libvaladoc/api/propertyaccessor.vala
+++ b/libvaladoc/api/propertyaccessor.vala
@@ -34,7 +34,7 @@ public class Valadoc.Api.PropertyAccessor : Symbol {
        public PropertyAccessor (Property parent, SourceFile file, string name, Vala.SymbolAccessibility 
accessibility,
                                                         string? cname, PropertyAccessorType type, Ownership 
ownership, Vala.PropertyAccessor data)
        {
-               base (parent, file, name, accessibility, data);
+               base (parent, file, name, accessibility, null, data);
 
                this.ownership = ownership;
                this.cname = cname;
diff --git a/libvaladoc/api/signal.vala b/libvaladoc/api/signal.vala
index e89836fcc..511be05bc 100644
--- a/libvaladoc/api/signal.vala
+++ b/libvaladoc/api/signal.vala
@@ -26,7 +26,7 @@ using Valadoc.Content;
 /**
  * Represents an signal.
  */
-public class Valadoc.Api.Signal : Member, Callable {
+public class Valadoc.Api.Signal : Symbol, Callable {
        private string? default_impl_cname;
        private string? dbus_name;
        private string? cname;
diff --git a/libvaladoc/api/symbol.vala b/libvaladoc/api/symbol.vala
index c68270e0f..7acc29bc5 100644
--- a/libvaladoc/api/symbol.vala
+++ b/libvaladoc/api/symbol.vala
@@ -27,6 +27,7 @@
  */
 public abstract class Valadoc.Api.Symbol : Node {
        private Vala.ArrayList<Attribute> attributes;
+       private SourceComment? source_comment;
 
        public bool is_deprecated {
                default = false;
@@ -35,11 +36,12 @@ public abstract class Valadoc.Api.Symbol : Node {
        }
 
        public Symbol (Node parent, SourceFile file, string? name, Vala.SymbolAccessibility accessibility,
-                                  Vala.Symbol data)
+                                  SourceComment? comment, Vala.Symbol data)
        {
                base (parent, file, name, data);
 
                this.accessibility = accessibility;
+               this.source_comment = comment;
        }
 
        public void add_attribute (Attribute att) {
@@ -153,5 +155,31 @@ public abstract class Valadoc.Api.Symbol : Node {
                        return accessibility == Vala.SymbolAccessibility.PRIVATE;
                }
        }
+
+       /**
+        * {@inheritDoc}
+        */
+       internal override void parse_comments (Settings settings, DocumentationParser parser) {
+               if (documentation != null) {
+                       return ;
+               }
+
+               if (source_comment != null) {
+                       documentation = parser.parse (this, source_comment);
+               }
+
+               base.parse_comments (settings, parser);
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       internal override void check_comments (Settings settings, DocumentationParser parser) {
+               if (documentation != null) {
+                       parser.check (this, documentation);
+               }
+
+               base.check_comments (settings, parser);
+       }
 }
 
diff --git a/libvaladoc/api/typeparameter.vala b/libvaladoc/api/typeparameter.vala
index c2b773e7b..410cb7912 100644
--- a/libvaladoc/api/typeparameter.vala
+++ b/libvaladoc/api/typeparameter.vala
@@ -29,7 +29,7 @@ using Valadoc.Content;
 public class Valadoc.Api.TypeParameter : Symbol {
 
        public TypeParameter (Node parent, SourceFile file, string name, Vala.TypeParameter data) {
-               base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, data);
+               base (parent, file, name, Vala.SymbolAccessibility.PUBLIC, null, data);
        }
 
        /**
diff --git a/libvaladoc/api/typesymbol.vala b/libvaladoc/api/typesymbol.vala
index ce377585d..e58a56525 100644
--- a/libvaladoc/api/typesymbol.vala
+++ b/libvaladoc/api/typesymbol.vala
@@ -26,7 +26,6 @@
  * Represents a runtime data type.
  */
 public abstract class Valadoc.Api.TypeSymbol : Symbol {
-       private SourceComment? source_comment;
        private string? type_macro_name;
        private string? is_type_macro_name;
        private string? type_cast_macro_name;
@@ -37,7 +36,7 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
                                           string? type_cast_macro_name, string? type_function_name, bool 
is_basic_type,
                                           Vala.TypeSymbol data)
        {
-               base (parent, file, name, accessibility, data);
+               base (parent, file, name, accessibility, comment, data);
 
                this.type_cast_macro_name = type_cast_macro_name;
                this.is_type_macro_name = is_type_macro_name;
@@ -45,7 +44,6 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
                this.type_macro_name = type_macro_name;
 
                this.is_basic_type = is_basic_type;
-               this.source_comment = comment;
        }
 
        /**
@@ -83,30 +81,4 @@ public abstract class Valadoc.Api.TypeSymbol : Symbol {
        public string get_type_function_name () {
                return type_function_name;
        }
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void parse_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       return ;
-               }
-
-               if (source_comment != null) {
-                       documentation = parser.parse (this, source_comment);
-               }
-
-               base.parse_comments (settings, parser);
-       }
-
-       /**
-        * {@inheritDoc}
-        */
-       internal override void check_comments (Settings settings, DocumentationParser parser) {
-               if (documentation != null) {
-                       parser.check (this, documentation);
-               }
-
-               base.check_comments (settings, parser);
-       }
 }


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