]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
libvaladoc/girimporter: parse_constant() use "c:identifier" attribute first
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 20 Mar 2021 15:19:35 +0000 (16:19 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 4 Apr 2021 13:43:21 +0000 (15:43 +0200)
libvaladoc/importer/girdocumentationimporter.vala

index e0ae01d6cab4786d9c37f60f04049db14faa3a01..057ab499b62dca8300107e3c3ccd39675506fc20 100644 (file)
@@ -849,7 +849,15 @@ public class Valadoc.Importer.GirDocumentationImporter : DocumentationImporter {
 
        private void parse_constant () {
                start_element ("constant");
-               string c_identifier = reader.get_attribute ("c:type");
+               string c_identifier = reader.get_attribute ("c:identifier");
+               if (c_identifier == null) {
+                       //TODO G-I seems to do this wrong
+                       c_identifier = reader.get_attribute ("c:type");
+               }
+               if (c_identifier == null) {
+                       skip_element ();
+                       return ;
+               }
                next ();
 
                Api.GirSourceComment? comment = parse_symbol_doc ();