Skip to content

Commit

Permalink
girparser: Handle doc:format element in root:repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ricotz committed Feb 17, 2025
1 parent d7d33aa commit 0e7fceb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@ TESTS = \
gir/delegate-closure-destroy-index-conflict.gir \
gir/delegate-error-pos.gir \
gir/dev_t.gir \
gir/doc-format.gir \
gir/enum.gir \
gir/errordomain.gir \
gir/gid_t.gir \
Expand Down
11 changes: 11 additions & 0 deletions tests/gir/doc-format.gir
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 3 additions & 0 deletions tests/gir/doc-format.vapi-expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[CCode (cprefix = "Test", gir_namespace = "Test", gir_version = "1.0", lower_case_cprefix = "test_")]
namespace Test {
}
3 changes: 3 additions & 0 deletions vala/valagirparser.vala
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,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);
Expand Down

0 comments on commit 0e7fceb

Please sign in to comment.