[vala] girparser: Fix renaming classes and interfaces



commit 2ef5f0fe2ec901b7939675cdf0424a53cab32a06
Author: Luca Bruno <lucabru src gnome org>
Date:   Tue Jul 26 20:49:26 2011 +0200

    girparser: Fix renaming classes and interfaces

 vala/valagirparser.vala |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 67d9941..a89b810 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -499,6 +499,8 @@ public class Vala.GirParser : CodeVisitor {
 		public ArrayList<int> array_length_parameters;
 		public ArrayList<int> closure_parameters;
 		public ArrayList<int> destroy_parameters;
+		// record-specific
+		public UnresolvedSymbol gtype_struct_for;
 		// alias-specific
 		public DataType base_type;
 
@@ -783,11 +785,10 @@ public class Vala.GirParser : CodeVisitor {
 						merged = true;
 					}
 
-					var gtype_struct_for = parent.girdata["glib:is-gtype-struct-for"];
-					if (field.variable_type is DelegateType && gtype_struct_for != null) {
+					if (field.variable_type is DelegateType && parent.gtype_struct_for != null) {
 						// virtual method field
 						var d = ((DelegateType) field.variable_type).delegate_symbol;
-						parser.process_virtual_method_field (this, d, parser.parse_symbol_from_string (gtype_struct_for, d.source_reference));
+						parser.process_virtual_method_field (this, d, parent.gtype_struct_for);
 						merged = true;
 					} else if (field.variable_type is ArrayType) {
 						Node array_length;
@@ -2166,6 +2167,11 @@ public class Vala.GirParser : CodeVisitor {
 		st.access = SymbolAccessibility.PUBLIC;
 
 		var gtype_struct_for = reader.get_attribute ("glib:is-gtype-struct-for");
+		if (gtype_struct_for != null) {
+			current.gtype_struct_for = parse_symbol_from_string (gtype_struct_for, current.source_reference);
+			unresolved_gir_symbols.add (current.gtype_struct_for);
+		}
+
 		bool first_field = true;
 		next ();
 		while (current_token == MarkupTokenType.START_ELEMENT) {



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