]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: skip doc-version, -deprecated, and -stability
authorEvan Nemerson <evan@coeus-group.com>
Wed, 13 Feb 2013 09:27:10 +0000 (01:27 -0800)
committerColin Walters <walters@verbum.org>
Wed, 9 Oct 2013 20:56:59 +0000 (16:56 -0400)
These element aren't in GObject Introspection yet, but should be coming
soon.  Since we don't want to parse the docbook we'll just skip them
instead of tryin to add the information to the VAPI.

vala/valagirparser.vala

index 8413e9ebc81b1f8b12c147f882207e388567b978..4fb2e9a4bca6466922b26a2702d1317cce60badb 100644 (file)
@@ -2026,21 +2026,29 @@ public class Vala.GirParser : CodeVisitor {
        }
 
        GirComment? parse_symbol_doc () {
-               if (reader.name != "doc") {
-                       return null;
-               }
+               GirComment? comment = null;
 
-               start_element ("doc");
-               next ();
+               while (current_token == MarkupTokenType.START_ELEMENT) {
+                       unowned string reader_name = reader.name;
 
-               GirComment? comment = null;
+                       if (reader_name == "doc") {
+                               start_element ("doc");
+                               next ();
 
-               if (current_token == MarkupTokenType.TEXT) {
-                       comment = new GirComment (reader.content, current.source_reference);
-                       next ();
+
+                               if (current_token == MarkupTokenType.TEXT) {
+                                       comment = new GirComment (reader.content, current.source_reference);
+                                       next ();
+                               }
+
+                               end_element ("doc");
+                       } else if (reader_name == "doc-version" || reader_name == "doc-deprecated" || reader_name == "doc-stability") {
+                               skip_element ();
+                       } else {
+                               break;
+                       }
                }
 
-               end_element ("doc");
                return comment;
        }