[vala/wip/attributes: 108/119] More



commit 260e866596903c410547ed36e0beb84615cc4f14
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun Jul 3 16:43:31 2011 +0200

    More

 codegen/valaccodebasemodule.vala         |    8 ++-
 codegen/valaccodememberaccessmodule.vala |    2 +-
 codegen/valagirwriter.vala               |    2 +-
 codegen/valagobjectmodule.vala           |    6 +-
 codegen/valagtypemodule.vala             |    2 +-
 vala/valacodenode.vala                   |    2 +-
 vala/valagirparser.vala                  |   19 +++--
 vala/valamethod.vala                     |    7 ++-
 vala/valaproperty.vala                   |   34 +---------
 vala/valastruct.vala                     |    2 +
 vala/valasymbol.vala                     |    4 +-
 vapigen/valagidlparser.vala              |  112 +++++++++++++++---------------
 12 files changed, 92 insertions(+), 108 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index e42c9ad..b3ef49b 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -1613,7 +1613,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 			    (acc.writable || acc.construction)) {
 				var notify_call = new CCodeFunctionCall (new CCodeIdentifier ("g_object_notify"));
 				notify_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("self"), "GObject *"));
-				notify_call.add_argument (prop.get_canonical_cconstant ());
+				notify_call.add_argument (get_property_canonical_cconstant (prop));
 				ccode.add_expression (notify_call);
 			}
 
@@ -5349,7 +5349,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
 		if (get_ccode_no_accessor_method (prop)) {
 			/* property name is second argument of g_object_set */
-			ccall.add_argument (prop.get_canonical_cconstant ());
+			ccall.add_argument (get_property_canonical_cconstant (prop));
 		}
 
 		var cexpr = get_cvalue_ (value);
@@ -5899,6 +5899,10 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 		return new CCodeConstant (str.str);
 	}
 
+	public CCodeConstant get_property_canonical_cconstant (Property prop) {
+		return new CCodeConstant ("\"%s\"".printf (prop.name.replace ("_", "-")));
+	}
+
 	public override void visit_class (Class cl) {
 	}
 
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index c8b3190..fdd2fb1 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -282,7 +282,7 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
 				ccall.add_argument (pub_inst);
 
 				// property name is second argument of g_object_get
-				ccall.add_argument (prop.get_canonical_cconstant ());
+				ccall.add_argument (get_property_canonical_cconstant (prop));
 
 				// g_object_get always returns owned values
 				// therefore, property getters of properties
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 4e0cd7f..d40931c 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -934,7 +934,7 @@ public class Vala.GIRWriter : CodeVisitor {
 		}
 
 		write_indent ();
-		buffer.append_printf ("<property name=\"%s\"", prop.get_canonical_name ());
+		buffer.append_printf ("<property name=\"%s\"", prop.name.replace ("_", "-"));
 		if (prop.get_accessor == null) {
 			buffer.append_printf (" readable=\"0\"");
 		}
diff --git a/codegen/valagobjectmodule.vala b/codegen/valagobjectmodule.vala
index 394d378..311ee3e 100644
--- a/codegen/valagobjectmodule.vala
+++ b/codegen/valagobjectmodule.vala
@@ -141,7 +141,7 @@ public class Vala.GObjectModule : GTypeModule {
 				var cinst = new CCodeFunctionCall (new CCodeIdentifier ("g_object_class_override_property"));
 				cinst.add_argument (ccall);
 				cinst.add_argument (new CCodeConstant (get_ccode_upper_case_name (prop)));
-				cinst.add_argument (prop.get_canonical_cconstant ());
+				cinst.add_argument (get_property_canonical_cconstant (prop));
 			
 				ccode.add_expression (cinst);
 			} else {
@@ -531,7 +531,7 @@ public class Vala.GObjectModule : GTypeModule {
 
 		var call = new CCodeFunctionCall (new CCodeIdentifier ("g_object_get"));
 		call.add_argument (new CCodeIdentifier ("obj"));
-		call.add_argument (prop.get_canonical_cconstant ());
+		call.add_argument (get_property_canonical_cconstant (prop));
 		call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("result")));
 		call.add_argument (new CCodeConstant ("NULL"));
 
@@ -565,7 +565,7 @@ public class Vala.GObjectModule : GTypeModule {
 
 		var call = new CCodeFunctionCall (new CCodeIdentifier ("g_object_set"));
 		call.add_argument (new CCodeIdentifier ("obj"));
-		call.add_argument (prop.get_canonical_cconstant ());
+		call.add_argument (get_property_canonical_cconstant (prop));
 		call.add_argument (new CCodeIdentifier ("value"));
 		call.add_argument (new CCodeConstant ("NULL"));
 
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index 65637b5..2a85c07 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -1655,7 +1655,7 @@ public class Vala.GTypeModule : GErrorModule {
 
 	public override CCodeFunctionCall get_param_spec (Property prop) {
 		var cspec = new CCodeFunctionCall ();
-		cspec.add_argument (prop.get_canonical_cconstant ());
+		cspec.add_argument (get_property_canonical_cconstant (prop));
 		cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.nick)));
 		cspec.add_argument (new CCodeConstant ("\"%s\"".printf (prop.blurb)));
 
diff --git a/vala/valacodenode.vala b/vala/valacodenode.vala
index ed5ee79..33b51d7 100644
--- a/vala/valacodenode.vala
+++ b/vala/valacodenode.vala
@@ -237,7 +237,7 @@ public abstract class Vala.CodeNode {
 	 * @param argument  argument name
 	 * @return          bool value
 	 */
-	public bool get_attribute_bool (string attribute, string argument, bool default_value) {
+	public bool get_attribute_bool (string attribute, string argument, bool default_value = false) {
 		var a = get_attribute (attribute);
 		if (a == null) {
 			return default_value;
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 7b1dc02..e3a67ae 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -839,12 +839,17 @@ public class Vala.GirParser : CodeVisitor {
 				}
 
 				// deprecation
-				symbol.replacement = metadata.get_string (ArgumentType.REPLACEMENT);
-				symbol.deprecated_since = metadata.get_string (ArgumentType.DEPRECATED_SINCE);
-				if (symbol.deprecated_since == null) {
-					symbol.deprecated_since = girdata.get ("deprecated-version");
+				if (metadata.has_argument (ArgumentType.REPLACEMENT)) {
+					symbol.set_attribute_string ("Deprecated", "replacement", metadata.get_string (ArgumentType.REPLACEMENT));
+				}
+				if (metadata.has_argument (ArgumentType.DEPRECATED_SINCE)) {
+					symbol.set_attribute_string ("Deprecated", "since",  metadata.get_string (ArgumentType.DEPRECATED_SINCE));
+				} else if (girdata["deprecated-version"] != null) {
+					symbol.set_attribute_string ("Deprecated", "since", girdata.get ("deprecated-version"));
+				}
+				if (metadata.get_bool (ArgumentType.DEPRECATED)) {
+					symbol.set_attribute ("Deprecated", true);
 				}
-				symbol.deprecated = metadata.get_bool (ArgumentType.DEPRECATED) || symbol.replacement != null || symbol.deprecated_since != null;
 
 				// cheader filename
 				var cheader_filename = metadata.get_string (ArgumentType.CHEADER_FILENAME);
@@ -1739,7 +1744,7 @@ public class Vala.GirParser : CodeVisitor {
 			} else {
 				var en = new Enum (current.name, current.source_reference);
 				if (element_name == "bitfield") {
-					en.is_flags = true;
+					en.set_attribute ("Flags", true);
 				}
 				sym = en;
 			}
@@ -2497,7 +2502,7 @@ public class Vala.GirParser : CodeVisitor {
 
 		if (s is Method) {
 			var m = (Method) s;
-			m.printf_format = metadata.get_bool (ArgumentType.PRINTF_FORMAT);
+			m.set_attribute ("PrintfFormat", metadata.get_bool (ArgumentType.PRINTF_FORMAT));
 			if (metadata.has_argument (ArgumentType.SENTINEL)) {
 				m.set_attribute_string ("CCode", "sentinel", metadata.get_string (ArgumentType.SENTINEL));
 			}
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index f275f7c..4c5cd1f 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -116,7 +116,7 @@ public class Vala.Method : Subroutine {
 	public bool printf_format {
 		get {
 			if (_printf_format == null) {
-				_printf_format = get_attribute ("PrintfFormat");
+				_printf_format = get_attribute ("PrintfFormat") != null;
 			}
 			return _printf_format;
 		}
@@ -128,7 +128,7 @@ public class Vala.Method : Subroutine {
 	public bool scanf_format {
 		get {
 			if (_scanf_format == null) {
-				_scanf_format = get_attribute ("ScanfFormat");
+				_scanf_format = get_attribute ("ScanfFormat") != null;
 			}
 			return _scanf_format;
 		}
@@ -170,6 +170,9 @@ public class Vala.Method : Subroutine {
 	private Method _base_interface_method;
 	private bool base_methods_valid;
 
+	private bool? _printf_format;
+	private bool? _scanf_format;
+
 	Method? callback_method;
 
 	// only valid for closures
diff --git a/vala/valaproperty.vala b/vala/valaproperty.vala
index cc1909c..a6da453 100644
--- a/vala/valaproperty.vala
+++ b/vala/valaproperty.vala
@@ -140,7 +140,7 @@ public class Vala.Property : Symbol, Lockable {
 	public string nick {
 		get {
 			if (_nick == null) {
-				_nick = get_canonical_name ();
+				_nick = name.replace ("_", "-");
 			}
 			return _nick;
 		}
@@ -153,7 +153,7 @@ public class Vala.Property : Symbol, Lockable {
 	public string blurb {
 		get {
 			if (_blurb == null) {
-				_blurb = get_canonical_name ();
+				_blurb = nick;
 			}
 			return _blurb;
 		}
@@ -210,34 +210,6 @@ public class Vala.Property : Symbol, Lockable {
 	}
 
 	/**
-	 * Returns the string literal of this property to be used in C code.
-	 *
-	 * @return string literal to be used in C code
-	 */
-	public CCodeConstant get_canonical_cconstant () {
-		return new CCodeConstant ("\"%s\"".printf (get_canonical_name ()));
-	}
-
-	public string get_canonical_name () {
-		var str = new StringBuilder ();
-		
-		string i = name;
-		
-		while (i.length > 0) {
-			unichar c = i.get_char ();
-			if (c == '_') {
-				str.append_c ('-');
-			} else {
-				str.append_unichar (c);
-			}
-			
-			i = i.next_char ();
-		}
-		
-		return str.str;
-	}
-
-	/**
 	 * Process all associated attributes.
 	 */
 	public void process_attributes () {
@@ -249,8 +221,6 @@ public class Vala.Property : Symbol, Lockable {
 				if (a.has_argument ("blurb")) {
 					blurb = a.get_string ("blurb");
 				}
-			} else if (a.name == "Deprecated") {
-				process_deprecated_attribute (a);
 			}			
 		}
 	}
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index a8558cb..801766e 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -39,6 +39,7 @@ public class Vala.Struct : TypeSymbol {
 	private bool? decimal_floating_type;
 	private bool? simple_type;
 	private int? rank;
+	private bool? _is_immutable;
 
 	/**
 	 * Specifies the base type.
@@ -79,6 +80,7 @@ public class Vala.Struct : TypeSymbol {
 			if (_is_immutable == null) {
 				_is_immutable = get_attribute ("Immutable") != null;
 			}
+			return _is_immutable;
 		}
 	}
 
diff --git a/vala/valasymbol.vala b/vala/valasymbol.vala
index ed75dd9..57106f7 100644
--- a/vala/valasymbol.vala
+++ b/vala/valasymbol.vala
@@ -83,7 +83,7 @@ public abstract class Vala.Symbol : CodeNode {
 	 * Specifies what version this symbol has been deprecated since.
 	 */
 	public string? deprecated_since {
-		get {
+		owned get {
 			return get_attribute_string ("Deprecated", "since");
 		}
 	}
@@ -92,7 +92,7 @@ public abstract class Vala.Symbol : CodeNode {
 	 * Specifies the replacement if this symbol has been deprecated.
 	 */
 	public string? replacement {
-		get {
+		owned get {
 			return get_attribute_string ("Deprecated", "replacement");
 		}
 	}
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index 36039da..b3d0f56 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -568,12 +568,12 @@ public class Vala.GIdlParser : CodeVisitor {
 					cb.return_type = return_type = parse_type_from_string (eval (nv[1]), return_type.value_owned);
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						cb.deprecated = true;
+						cb.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					cb.replacement = eval (nv[1]);
+					cb.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					cb.deprecated_since = eval (nv[1]);
+					cb.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "type_arguments") {
 					parse_type_arguments_from_string (return_type, eval (nv[1]));
 				} else if (nv[0] == "instance_pos") {
@@ -584,7 +584,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					}
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						cb.experimental = true;
+						cb.set_attribute ("Experimental", true);
 					}
 				}
 			}
@@ -755,7 +755,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "immutable") {
 							if (eval (nv[1]) == "1") {
-								st.is_immutable = true;
+								st.set_attribute ("Immutable", true);
 							}
 						} else if (nv[0] == "has_type_id") {
 							if (eval (nv[1]) == "0") {
@@ -769,19 +769,19 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
-								st.deprecated = true;
+								st.set_attribute ("Deprecated", true);
 							}
 						} else if (nv[0] == "replacement") {
-							st.replacement = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 						} else if (nv[0] == "deprecated_since") {
-							st.deprecated_since = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 						} else if (nv[0] == "has_destroy_function") {
 							if (eval (nv[1]) == "0") {
 								st.set_attribute_bool ("CCode", "has_destroy_function", false);
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {
-								st.experimental = true;
+								st.set_attribute ("Experimental", true);
 							}
 						}
 					}
@@ -863,19 +863,19 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
-								cl.deprecated = true;
+								cl.set_attribute ("Deprecated", true);
 							}
 						} else if (nv[0] == "replacement") {
-							cl.replacement = eval (nv[1]);
+							cl.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 						} else if (nv[0] == "deprecated_since") {
-							cl.deprecated_since = eval (nv[1]);
+							cl.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 						} else if (nv[0] == "type_parameters") {
 							foreach (string type_param_name in eval (nv[1]).split (",")) {
 								cl.add_type_parameter (new TypeParameter (type_param_name, current_source_reference));
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {
-								cl.experimental = true;
+								cl.set_attribute ("Experimental", true);
 							}
 						}
 					}
@@ -958,19 +958,19 @@ public class Vala.GIdlParser : CodeVisitor {
 							st.set_attribute_string ("CCode", "cheader_filename", eval (nv[1]));
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
-								st.deprecated = true;
+								st.set_attribute ("Deprecated", true);
 							}
 						} else if (nv[0] == "replacement") {
-							st.replacement = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 						} else if (nv[0] == "deprecated_since") {
-							st.deprecated_since = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 						} else if (nv[0] == "hidden") {
 							if (eval (nv[1]) == "1") {
 								return;
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {
-								st.experimental = true;
+								st.set_attribute ("Experimental", true);
 							}
 						}
 					}
@@ -1102,15 +1102,15 @@ public class Vala.GIdlParser : CodeVisitor {
 							st.set_attribute_string ("CCode", "cheader_filename", eval (nv[1]));
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
-								st.deprecated = true;
+								st.set_attribute ("Deprecated", true);
 							}
 						} else if (nv[0] == "replacement") {
-							st.replacement = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 						} else if (nv[0] == "deprecated_since") {
-							st.deprecated_since = eval (nv[1]);
+							st.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 						} else if (nv[0] == "immutable") {
 							if (eval (nv[1]) == "1") {
-								st.is_immutable = true;
+								st.set_attribute ("Immutable", true);
 							}
 						} else if (nv[0] == "has_copy_function") {
 							if (eval (nv[1]) == "0") {
@@ -1122,7 +1122,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {
-								st.experimental = true;
+								st.set_attribute ("Experimental", true);
 							}
 						}
 					}
@@ -1178,12 +1178,12 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "deprecated") {
 							if (eval (nv[1]) == "1") {
-								cl.deprecated = true;
+								cl.set_attribute ("Deprecated", true);
 							}
 						} else if (nv[0] == "replacement") {
-							cl.replacement = eval (nv[1]);
+							cl.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 						} else if (nv[0] == "deprecated_since") {
-							cl.deprecated_since = eval (nv[1]);
+							cl.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 						} else if (nv[0] == "const_cname") {
 							cl.set_attribute_string ("CCode", "const_cname", eval (nv[1]));
 						} else if (nv[0] == "free_function") {
@@ -1200,7 +1200,7 @@ public class Vala.GIdlParser : CodeVisitor {
 							}
 						} else if (nv[0] == "experimental") {
 							if (eval (nv[1]) == "1") {
-								cl.experimental = true;
+								cl.set_attribute ("Experimental", true);
 							}
 						}
 					}
@@ -1337,12 +1337,12 @@ public class Vala.GIdlParser : CodeVisitor {
 					}
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						en.deprecated = true;
+						en.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					en.replacement = eval (nv[1]);
+					en.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					en.deprecated_since = eval (nv[1]);
+					en.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "rename_to") {
 					en.name = eval (nv[1]);
 				} else if (nv[0] == "errordomain") {
@@ -1359,7 +1359,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					en.add_method (m);
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						en.experimental = true;
+						en.set_attribute ("Experimental", true);
 					}
 				}
 			}
@@ -1403,7 +1403,7 @@ public class Vala.GIdlParser : CodeVisitor {
 				add_symbol_to_container (container, ed);
 			}
 		} else {
-			en.is_flags = is_flags;
+			en.set_attribute ("Flags", is_flags);
 			current_source_file.add_node (en);
 			if (!existing) {
 				add_symbol_to_container (container, en);
@@ -1437,12 +1437,12 @@ public class Vala.GIdlParser : CodeVisitor {
 						cl.set_attribute_string ("CCode", "type_check_function", eval (nv[1]));
 					} else if (nv[0] == "deprecated") {
 						if (eval (nv[1]) == "1") {
-							cl.deprecated = true;
+							cl.set_attribute ("Deprecated", true);
 						}
 					} else if (nv[0] == "replacement") {
-						cl.replacement = eval (nv[1]);
+						cl.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 					} else if (nv[0] == "deprecated_since") {
-						cl.deprecated_since = eval (nv[1]);
+						cl.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 					} else if (nv[0] == "type_id") {
 						cl.set_attribute_string ("CCode", "type_id", eval (nv[1]));
 					} else if (nv[0] == "abstract") {
@@ -1451,7 +1451,7 @@ public class Vala.GIdlParser : CodeVisitor {
 						}
 					} else if (nv[0] == "experimental") {
 						if (eval (nv[1]) == "1") {
-							cl.experimental = true;
+							cl.set_attribute ("Experimental", true);
 						}
 					}
 				}
@@ -2142,7 +2142,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					}
 				} else if (nv[0] == "printf_format") {
 					if (eval (nv[1]) == "1") {
-						m.printf_format = true;
+						m.set_attribute ("PrintfFormat", true);
 					}
 				} else if (nv[0] == "transfer_ownership") {
 					if (eval (nv[1]) == "1") {
@@ -2186,12 +2186,12 @@ public class Vala.GIdlParser : CodeVisitor {
 					parse_type_arguments_from_string (return_type, eval (nv[1]));
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						m.deprecated = true;
+						m.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					m.replacement = eval (nv[1]);
+					m.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					m.deprecated_since = eval (nv[1]);
+					m.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "cheader_filename") {
 					m.set_attribute_string ("CCode", "cheader_filename", eval (nv[1]));
 				} else if (nv[0] == "abstract") {
@@ -2219,7 +2219,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					}
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						m.experimental = true;
+						m.set_attribute ("Experimental", true);
 					}
 				} else if (nv[0] == "simple_generics") {
 					if (eval (nv[1]) == "1") {
@@ -2584,12 +2584,12 @@ public class Vala.GIdlParser : CodeVisitor {
 					parse_type_arguments_from_string (prop.property_type, eval (nv[1]));
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						prop.deprecated = true;
+						prop.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					prop.replacement = eval (nv[1]);
+					prop.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					prop.deprecated_since = eval (nv[1]);
+					prop.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "accessor_method") {
 					if (eval (nv[1]) == "0") {
 						prop.set_attribute ("NoAccessorMethod", true);
@@ -2602,7 +2602,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					prop.property_type = parse_type_from_string (eval (nv[1]), false);
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						prop.experimental = true;
+						prop.set_attribute ("Experimental", true);
 					}
 				} else if (nv[0] == "nullable") {
 					if (eval (nv[1]) == "1") {
@@ -2638,19 +2638,19 @@ public class Vala.GIdlParser : CodeVisitor {
 					c.set_attribute_string ("CCode", "cheader_filename", eval (nv[1]));
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						c.deprecated = true;
+						c.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					c.replacement = eval (nv[1]);
+					c.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					c.deprecated_since = eval (nv[1]);
+					c.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "hidden") {
 					if (eval (nv[1]) == "1") {
 						return null;
 					}
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						c.experimental = true;
+						c.set_attribute ("Experimental", true);
 					}
 				}
 			}
@@ -2763,19 +2763,19 @@ public class Vala.GIdlParser : CodeVisitor {
 		}
 
 		if (deprecated) {
-			field.deprecated = true;
+			field.set_attribute ("Deprecated", true);
 
 			if (deprecated_since != null) {
-				field.deprecated_since = deprecated_since;
+				field.set_attribute_string ("Deprecated", "since", deprecated_since);
 			}
 
 			if (replacement != null) {
-				field.replacement = replacement;
+				field.set_attribute_string ("Deprecated", "replacement", replacement);
 			}
 		}
 
 		if (experimental) {
-			field.experimental = true;
+			field.set_attribute ("Experimental", true);
 		}
 
 		if (ctype != null) {
@@ -2905,12 +2905,12 @@ public class Vala.GIdlParser : CodeVisitor {
 					}
 				} else if (nv[0] == "deprecated") {
 					if (eval (nv[1]) == "1") {
-						sig.deprecated = true;
+						sig.set_attribute ("Deprecated", true);
 					}
 				} else if (nv[0] == "replacement") {
-					sig.replacement = eval (nv[1]);
+					sig.set_attribute_string ("Deprecated", "replacement", eval (nv[1]));
 				} else if (nv[0] == "deprecated_since") {
-					sig.deprecated_since = eval (nv[1]);
+					sig.set_attribute_string ("Deprecated", "since", eval (nv[1]));
 				} else if (nv[0] == "transfer_ownership") {
 					if (eval (nv[1]) == "1") {
 						sig.return_type.value_owned = true;
@@ -2923,7 +2923,7 @@ public class Vala.GIdlParser : CodeVisitor {
 					parse_type_arguments_from_string (sig.return_type, eval (nv[1]));
 				} else if (nv[0] == "experimental") {
 					if (eval (nv[1]) == "1") {
-						sig.experimental = true;
+						sig.set_attribute ("Experimental", true);
 					}
 				}
 			}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]