vala r2321 - in trunk: . compiler vala



Author: juergbi
Date: Sat Jan 10 12:46:42 2009
New Revision: 2321
URL: http://svn.gnome.org/viewvc/vala?rev=2321&view=rev

Log:
2009-01-10  JÃrg Billeter  <j bitron ch>

	* vala/valacodecontext.vala:
	* vala/valaobjectcreationexpression.vala:
	* compiler/valacompiler.vala:

	Add --enable-deprecated and --enable-experimental command-line
	options to disable warnings when using deprecated and experimental
	features, respectively


Modified:
   trunk/ChangeLog
   trunk/compiler/valacompiler.vala
   trunk/vala/valacodecontext.vala
   trunk/vala/valaobjectcreationexpression.vala

Modified: trunk/compiler/valacompiler.vala
==============================================================================
--- trunk/compiler/valacompiler.vala	(original)
+++ trunk/compiler/valacompiler.vala	Sat Jan 10 12:46:42 2009
@@ -46,6 +46,8 @@
 	static bool thread;
 	static bool disable_assert;
 	static bool enable_checking;
+	static bool deprecated;
+	static bool experimental;
 	static bool non_null_experimental;
 	static bool disable_dbus_transformation;
 	static string cc_command;
@@ -72,6 +74,8 @@
 		{ "thread", 0, 0, OptionArg.NONE, ref thread, "Enable multithreading support", null },
 		{ "disable-assert", 0, 0, OptionArg.NONE, ref disable_assert, "Disable assertions", null },
 		{ "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable additional run-time checks", null },
+		{ "enable-deprecated", 0, 0, OptionArg.NONE, ref deprecated, "Enable deprecated features", null },
+		{ "enable-experimental", 0, 0, OptionArg.NONE, ref experimental, "Enable experimental features", null },
 		{ "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimental enhancements for non-null types", null },
 		{ "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
 		{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
@@ -154,6 +158,8 @@
 		context.library = library;
 		context.assert = !disable_assert;
 		context.checking = enable_checking;
+		context.deprecated = deprecated;
+		context.experimental = experimental;
 		context.non_null_experimental = non_null_experimental;
 		context.dbus_transformation = !disable_dbus_transformation;
 		Report.set_verbose_errors (!quiet_mode);

Modified: trunk/vala/valacodecontext.vala
==============================================================================
--- trunk/vala/valacodecontext.vala	(original)
+++ trunk/vala/valacodecontext.vala	Sat Jan 10 12:46:42 2009
@@ -51,6 +51,16 @@
 	public bool checking { get; set; }
 
 	/**
+	 * Do not warn when using deprecated features.
+	 */
+	public bool deprecated { get; set; }
+
+	/**
+	 * Do not warn when using experimental features.
+	 */
+	public bool experimental { get; set; }
+
+	/**
 	 * Enable experimental enhancements for non-null types.
 	 */
 	public bool non_null_experimental { get; set; }

Modified: trunk/vala/valaobjectcreationexpression.vala
==============================================================================
--- trunk/vala/valaobjectcreationexpression.vala	(original)
+++ trunk/vala/valaobjectcreationexpression.vala	Sat Jan 10 12:46:42 2009
@@ -266,7 +266,7 @@
 
 			expected_num_type_args = st.get_type_parameters ().size;
 
-			if (!struct_creation) {
+			if (!struct_creation && !analyzer.context.deprecated) {
 				Report.warning (source_reference, "deprecated syntax, don't use `new' to initialize structs");
 			}
 



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