From c546b2a453037af28518e856e6b83ad7fcb0a2b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Tue, 29 Jun 2010 21:01:02 +0200 Subject: [PATCH] girparser: Fix callback parsing --- vala/valagirparser.vala | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 7b63728f..b545b2d4 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; } -- 2.11.4.GIT