From: Corentin Noël Date: Mon, 19 Feb 2024 17:06:52 +0000 (+0100) Subject: libvaladoc: Add CommentParser interface X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beda8c8d6bd684f4643d1378ed0b4390c092c933;p=thirdparty%2Fvala.git libvaladoc: Add CommentParser interface This is the common denominator interface between Valadoc.Gtkdoc.Parser and Valadoc.Gtkdoc.MarkdownParser. --- diff --git a/libvaladoc/Makefile.am b/libvaladoc/Makefile.am index dad9a9e99..17dfbbe1f 100644 --- a/libvaladoc/Makefile.am +++ b/libvaladoc/Makefile.am @@ -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 index 000000000..124d99e97 --- /dev/null +++ b/libvaladoc/documentation/commentparser.vala @@ -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 + */ + +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); +} diff --git a/libvaladoc/documentation/gtkdoccommentparser.vala b/libvaladoc/documentation/gtkdoccommentparser.vala index dac5e4769..d4da4232f 100644 --- a/libvaladoc/documentation/gtkdoccommentparser.vala +++ b/libvaladoc/documentation/gtkdoccommentparser.vala @@ -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; diff --git a/libvaladoc/documentation/gtkdocmarkdownparser.vala b/libvaladoc/documentation/gtkdocmarkdownparser.vala index 8f7608a2f..61f9f99dd 100644 --- a/libvaladoc/documentation/gtkdocmarkdownparser.vala +++ b/libvaladoc/documentation/gtkdocmarkdownparser.vala @@ -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;