[vala] codegen: Add support for finish_vfunc_name in CCode
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Add support for finish_vfunc_name in CCode
- Date: Sun, 18 Sep 2016 13:46:21 +0000 (UTC)
commit a38fdd253569d3459204a08364d3ba8a831f32eb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Sep 18 15:36:06 2016 +0200
codegen: Add support for finish_vfunc_name in CCode
codegen/valaccodeattribute.vala | 7 ++++++-
vala/valagirparser.vala | 7 ++++++-
vapigen/valagidlparser.vala | 2 ++
3 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 38d2ebf..0383fe3 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -439,7 +439,12 @@ public class Vala.CCodeAttribute : AttributeCache {
public string finish_vfunc_name {
get {
if (_finish_vfunc_name == null) {
- _finish_vfunc_name = get_finish_name_for_basename (vfunc_name);
+ if (ccode != null) {
+ _finish_vfunc_name = ccode.get_string ("finish_vfunc_name");
+ }
+ if (_finish_vfunc_name == null) {
+ _finish_vfunc_name = get_finish_name_for_basename (vfunc_name);
+ }
}
return _finish_vfunc_name;
}
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 159ce9f..b453069 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -81,7 +81,8 @@ public class Vala.GirParser : CodeVisitor {
FLOATING,
TYPE_ID,
RETURN_VOID,
- DELEGATE_TARGET_CNAME;
+ DELEGATE_TARGET_CNAME,
+ FINISH_VFUNC_NAME;
public static ArgumentType? from_string (string name) {
var enum_class = (EnumClass) typeof(ArgumentType).class_ref ();
@@ -3081,6 +3082,10 @@ public class Vala.GirParser : CodeVisitor {
method.set_attribute_string ("CCode", "vfunc_name", metadata.get_string
(ArgumentType.VFUNC_NAME));
method.is_virtual = true;
}
+ if (metadata.has_argument (ArgumentType.FINISH_VFUNC_NAME)) {
+ method.set_attribute_string ("CCode", "finish_vfunc_name",
metadata.get_string (ArgumentType.FINISH_VFUNC_NAME));
+ method.is_virtual = true;
+ }
}
if (!(metadata.get_expression (ArgumentType.THROWS) is NullLiteral)) {
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 380fb0a..543b686 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -2349,6 +2349,8 @@ public class Vala.GIdlParser : CodeVisitor {
}
} else if (nv[0] == "vfunc_name") {
m.set_attribute_string ("CCode", "vfunc_name", eval (nv[1]));
+ } else if (nv[0] == "finish_vfunc_name") {
+ m.set_attribute_string ("CCode", "finish_vfunc_name", eval (nv[1]));
} else if (nv[0] == "finish_name") {
m.set_attribute_string ("CCode", "finish_name", eval (nv[1]));
} else if (nv[0] == "async") {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]