[vala/switch-to-gir: 31/36] girparser: Skip class field that refer to the parent instance
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 31/36] girparser: Skip class field that refer to the parent instance
- Date: Sat, 6 Nov 2010 11:50:59 +0000 (UTC)
commit 84c18c4f0f0404050d651b5126e749b26fd98a69
Author: Luca Bruno <lucabru src gnome org>
Date: Mon Aug 30 13:47:05 2010 +0200
girparser: Skip class field that refer to the parent instance
vala/valagirparser.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index b51daa5..e49aa39 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1869,6 +1869,7 @@ public class Vala.GirParser : CodeVisitor {
}
next ();
+ var first_field = true;
var old_symbols_info = current_symbols_info;
current_symbols_info = new HashMap<string,ArrayList<SymbolInfo>> (str_hash, str_equal);
while (current_token == MarkupTokenType.START_ELEMENT) {
@@ -1885,7 +1886,13 @@ public class Vala.GirParser : CodeVisitor {
} else if (reader.name == "constant") {
add_symbol_info (parse_constant ());
} else if (reader.name == "field") {
- add_symbol_info (parse_field ());
+ if (first_field && parent != null) {
+ // first field is guaranteed to be the parent instance
+ skip_element ();
+ } else {
+ add_symbol_info (parse_field ());
+ }
+ first_field = false;
} else if (reader.name == "property") {
add_symbol_info (parse_property ());
} else if (reader.name == "constructor") {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]