[vala/switch-to-gir: 39/47] girparser: Merge virtual method specified in metadata.
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 39/47] girparser: Merge virtual method specified in metadata.
- Date: Sun, 20 Feb 2011 18:59:55 +0000 (UTC)
commit 7ffa0e1912296fc02a4e97f0f104e42839606745
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Dec 30 19:44:18 2010 +0100
girparser: Merge virtual method specified in metadata.
vala/valagirparser.vala | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 62f027a..61dd969 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -958,8 +958,8 @@ public class Vala.GirParser : CodeVisitor {
m.attributes.remove (attr);
merged.add (invoker);
different_invoker = true;
- break;
}
+ break;
}
}
if (!different_invoker) {
@@ -967,6 +967,13 @@ public class Vala.GirParser : CodeVisitor {
}
}
}
+ // merge custom vfunc
+ if (info.metadata.has_argument (ArgumentType.VFUNC_NAME)) {
+ var vfunc = get_current_first_symbol_info (info.metadata.get_string (ArgumentType.VFUNC_NAME));
+ if (vfunc != null && vfunc != info) {
+ merged.add (vfunc);
+ }
+ }
if (m.coroutine) {
// handle async methods
string finish_method_base;
@@ -2318,7 +2325,10 @@ public class Vala.GirParser : CodeVisitor {
method.is_abstract = metadata.get_bool (ArgumentType.ABSTRACT);
method.is_virtual = false;
}
- method.vfunc_name = metadata.get_string (ArgumentType.VFUNC_NAME);
+ if (metadata.has_argument (ArgumentType.VFUNC_NAME)) {
+ method.vfunc_name = metadata.get_string (ArgumentType.VFUNC_NAME);
+ method.is_virtual = true;
+ }
}
var parameters = new ArrayList<ParameterInfo> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]