]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Handle `doc:format` element in root:repository
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 17 Feb 2025 17:30:20 +0000 (18:30 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 18 Feb 2025 22:22:14 +0000 (23:22 +0100)
See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/448

Fixes https://gitlab.gnome.org/GNOME/vala/issues/1586

tests/Makefile.am
tests/gir/doc-format.gir [new file with mode: 0644]
tests/gir/doc-format.vapi-expected [new file with mode: 0644]
vala/valagirparser.vala

index 6186afc50895f9cd0fe91e2c9ee1dcba5ecce4ce..fbbcd8e48394f414d7b2cbf5458ae09c53b8011d 100644 (file)
@@ -880,6 +880,7 @@ TESTS = \
        gir/delegate-array-length-type.gir \
        gir/delegate-closure-destroy-index-conflict.gir \
        gir/delegate-error-pos.gir \
+       gir/doc-format.gir \
        gir/enum.gir \
        gir/errordomain.gir \
        gir/gtype-struct-name.gir \
diff --git a/tests/gir/doc-format.gir b/tests/gir/doc-format.gir
new file mode 100644 (file)
index 0000000..a8b9c33
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
+<include name="GObject" version="2.0"/>
+<include name="GLib" version="2.0"/>
+<include name="Gio" version="2.0"/>
+<package name="test"/>
+<c:include name="test.h"/>
+<doc:format name="unknown"/>
+<namespace name="Test" version="1.0" shared-library="test" c:prefix="Test" c:identifier-prefixes="Test" c:symbol-prefixes="test">
+</namespace>
+</repository>
diff --git a/tests/gir/doc-format.vapi-expected b/tests/gir/doc-format.vapi-expected
new file mode 100644 (file)
index 0000000..233d3d8
--- /dev/null
@@ -0,0 +1,3 @@
+[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
+namespace Test {
+}
index dde72ee2bffbff82e2e7296cee336ac9cc69fde0..5bfa6284f23eabb332bec8b7e16cba7a94b00a8b 100644 (file)
@@ -2057,6 +2057,9 @@ public class Vala.GirParser : CodeVisitor {
                                }
                        } else if (reader.name == "c:include") {
                                parse_c_include ();
+                       } else if (reader.name == "doc:format") {
+                               //TODO Handle this format information properly
+                               skip_element ();
                        } else {
                                // error
                                Report.error (get_current_src (), "unknown child element `%s' in `repository'", reader.name);