[vala] girparser: Fix callback parsing



commit c546b2a453037af28518e856e6b83ad7fcb0a2b6
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jun 29 21:01:02 2010 +0200

    girparser: Fix callback parsing

 vala/valagirparser.vala |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 7b63728..b545b2d 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -919,7 +919,6 @@ public class Vala.GirParser : CodeVisitor {
 			start_element ("parameters");
 			next ();
 
-			bool first = true;
 			while (current_token == MarkupTokenType.START_ELEMENT) {
 				int array_length_idx, closure_idx, destroy_idx;
 				string scope;
@@ -934,25 +933,20 @@ public class Vala.GirParser : CodeVisitor {
 					destroy_parameters.add (destroy_idx);
 				}
 
-				// first parameter is instance pointer in virtual methods, ignore
-				if (element_name != "callback" || !first) {
-					var info = new MethodInfo(param, array_length_idx, closure_idx, destroy_idx);
+				var info = new MethodInfo(param, array_length_idx, closure_idx, destroy_idx);
 
-					if (s is Method && scope == "async") {
-						((Method) s).coroutine = true;
-						info.keep = false;
-					}
-
-					parameters.add (info);
-				} else {
-					first = false;
+				if (s is Method && scope == "async") {
+					((Method) s).coroutine = true;
+					info.keep = false;
 				}
+
+				parameters.add (info);
 			}
 			end_element ("parameters");
 		}
 		int i = 0, j=1, add=0;
 
-		if (element_name == "method" || element_name == "virtual-method" || element_name == "callback") {
+		if (element_name == "method" || element_name == "virtual-method") {
 			// implicit instance parameter
 			add = 1;
 		}



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