]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc: Add CommentParser interface
authorCorentin Noël <corentin.noel@collabora.com>
Mon, 19 Feb 2024 17:06:52 +0000 (18:06 +0100)
committerCorentin Noël <corentin.noel@collabora.com>
Mon, 19 Feb 2024 17:20:45 +0000 (18:20 +0100)
This is the common denominator interface between Valadoc.Gtkdoc.Parser and
Valadoc.Gtkdoc.MarkdownParser.

libvaladoc/Makefile.am
libvaladoc/documentation/commentparser.vala [new file with mode: 0644]
libvaladoc/documentation/gtkdoccommentparser.vala
libvaladoc/documentation/gtkdocmarkdownparser.vala

index dad9a9e99a21097ca07a3819c912b28e1f4f6335..17dfbbe1f067dcc4ac14dbb7dfcd6af4523f66e1 100644 (file)
@@ -37,6 +37,7 @@ libvaladoc_la_VALASOURCES = \
        devhelp-markupwriter.vala \
        ctyperesolver.vala \
        gtkdocrenderer.vala \
+       documentation/commentparser.vala \
        documentation/commentscanner.vala \
        documentation/documentation.vala \
        documentation/documentationparser.vala \
diff --git a/libvaladoc/documentation/commentparser.vala b/libvaladoc/documentation/commentparser.vala
new file mode 100644 (file)
index 0000000..124d99e
--- /dev/null
@@ -0,0 +1,28 @@
+/* commentparser.vala
+ *
+ * Copyright 2024 Collabora Ltd. (https://collabora.com)
+ *
+ * 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:
+ *     Corentin Noël <corentin.noel@collabora.com>
+ */
+
+using Valadoc.Content;
+using Valadoc;
+
+public interface CommentParser : GLib.Object {
+       public abstract Comment? parse (Api.Node element, Api.GirSourceComment gir_comment, GirMetaData gir_metadata, Importer.InternalIdRegistrar id_registrar);
+}
index dac5e4769ac43c9b5a2d98621264ee4a62acd536..d4da4232ff372505082813997b8097a03985d419 100644 (file)
@@ -24,7 +24,7 @@
 using Valadoc.Content;
 using Valadoc.Gtkdoc;
 
-public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator {
+public class Valadoc.Gtkdoc.Parser : Object, ResourceLocator, CommentParser {
        private Scanner scanner = new Scanner ();
        private Token current;
 
index 8f7608a2f6c36cfb26bfcc168e322d0656aeb639..61f9f99dde4cc0d3d0869d1dbae6ea7aa750f500 100644 (file)
@@ -24,7 +24,7 @@
 using Valadoc.Content;
 using Valadoc;
 
-public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator {
+public class Valadoc.Gtkdoc.MarkdownParser : Object, ResourceLocator, CommentParser {
        private Valadoc.Parser parser;
        private Content.ContentFactory _factory;