[vala/switch-to-gir: 26/34] girparser: Add symbol deprecation
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 26/34] girparser: Add symbol deprecation
- Date: Sun, 29 Aug 2010 22:25:01 +0000 (UTC)
commit c31a23b28a27af782017b56e41318aa8fe74de3c
Author: Luca Bruno <lucabru src gnome org>
Date: Sun Aug 29 15:20:55 2010 +0200
girparser: Add symbol deprecation
vala/valagirparser.vala | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 1973e8b..95f0bde 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -856,6 +856,11 @@ public class Vala.GirParser : CodeVisitor {
}
void postprocess_symbol (Symbol symbol, Metadata metadata) {
+ // deprecation
+ symbol.replacement = metadata.get_string (ArgumentType.REPLACEMENT);
+ symbol.deprecated_since = element_get_string ("deprecated-version", ArgumentType.DEPRECATED_SINCE);
+ symbol.deprecated = metadata.get_bool (ArgumentType.DEPRECATED) || symbol.replacement != null || symbol.deprecated_since != null;
+
// mark to be reparented
if (metadata.has_argument (ArgumentType.PARENT)) {
var target_symbol = parse_symbol_from_string (metadata.get_string (ArgumentType.PARENT), metadata.get_source_reference (ArgumentType.PARENT));
@@ -1054,6 +1059,14 @@ public class Vala.GirParser : CodeVisitor {
return type;
}
+ string? element_get_string (string attribute_name, ArgumentType arg_type) {
+ var str = metadata.get_string (arg_type);
+ if (str == null) {
+ str = reader.get_attribute (attribute_name);
+ }
+ return str;
+ }
+
DataType? element_get_type (DataType orig_type, bool owned_by_default, out bool changed = null) {
if (&changed != null) {
changed = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]