[vala] vapigen: Add support for type_parameters for delegates
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] vapigen: Add support for type_parameters for delegates
- Date: Thu, 8 Jul 2010 14:15:45 +0000 (UTC)
commit 51516f3399f34e77416e1fe3c87f988084346619
Author: Sebastian Dröge <sebastian droege collabora co uk>
Date: Thu Jul 8 16:10:17 2010 +0200
vapigen: Add support for type_parameters for delegates
Also add support for type_name for delegate parameters.
vapigen/valagidlparser.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index e42a24e..adcaedd 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -320,6 +320,10 @@ public class Vala.GIdlParser : CodeVisitor {
}
} else if (nv[0] == "instance_pos") {
cb.cinstance_parameter_position = eval (nv[1]).to_double ();
+ } else if (nv[0] == "type_parameters") {
+ foreach (string type_param_name in eval (nv[1]).split (",")) {
+ cb.add_type_parameter (new TypeParameter (type_param_name, current_source_reference));
+ }
}
}
}
@@ -405,6 +409,15 @@ public class Vala.GIdlParser : CodeVisitor {
if (eval (nv[1]) == "1") {
p.no_array_length = true;
}
+ } else if (nv[0] == "type_name") {
+ var sym = new UnresolvedSymbol (null, eval (nv[1]));
+ if (param_type is UnresolvedType) {
+ ((UnresolvedType) param_type).unresolved_symbol = sym;
+ } else {
+ // Overwrite old param_type, so "type_name" must be before any
+ // other param type modifying metadata
+ p.parameter_type = param_type = new UnresolvedType.from_symbol (sym, return_type.source_reference);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]