[vala] girparser: skip doc-version, -deprecated, and -stability



commit a739543513ad90b067e9cf5efc51b973e31ca436
Author: Evan Nemerson <evan coeus-group com>
Date:   Wed Feb 13 01:27:10 2013 -0800

    girparser: skip doc-version, -deprecated, and -stability
    
    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 |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 8413e9e..4fb2e9a 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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;
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]