vala r1491 - in trunk: . compiler vala



Author: juergbi
Date: Thu May 29 21:03:38 2008
New Revision: 1491
URL: http://svn.gnome.org/viewvc/vala?rev=1491&view=rev

Log:
2008-05-29  Juerg Billeter  <j bitron ch>

	* vala/valasourcefile.vala:
	* vala/valasourcereference.vala:
	* compiler/valacompiler.vala:

	Use verbose error messages by default, display relative filenames
	in error messages, fixes bug 535480


Modified:
   trunk/ChangeLog
   trunk/compiler/valacompiler.vala
   trunk/vala/valasourcefile.vala
   trunk/vala/valasourcereference.vala

Modified: trunk/compiler/valacompiler.vala
==============================================================================
--- trunk/compiler/valacompiler.vala	(original)
+++ trunk/compiler/valacompiler.vala	Thu May 29 21:03:38 2008
@@ -44,7 +44,6 @@
 	static bool disable_checking;
 	static bool disable_non_null;
 	static bool non_null_experimental;
-	static bool verbose;
 	static string cc_command;
 	[NoArrayLength]
 	static string[] cc_options;
@@ -76,7 +75,6 @@
 		{ "Xcc", 'X', 0, OptionArg.STRING_ARRAY, out cc_options, "Pass OPTION to the C compiler", "OPTION..." },
 		{ "save-temps", 0, 0, OptionArg.NONE, out save_temps, "Keep temporary files", null },
 		{ "quiet", 'q', 0, OptionArg.NONE, ref quiet_mode, "Do not print messages to the console", null },
-		{ "verbose", 'v', 0, OptionArg.NONE, ref verbose, "Include the source line text when reporting errors or warnings." },
 		{ "", 0, 0, OptionArg.FILENAME_ARRAY, out sources, null, "FILE..." },
 		{ null }
 	};
@@ -153,7 +151,7 @@
 		context.checking = !disable_checking;
 		context.non_null = !disable_non_null || non_null_experimental;
 		context.non_null_experimental = non_null_experimental;
-		Report.set_verbose_errors (verbose);
+		Report.set_verbose_errors (!quiet_mode);
 
 		context.ccode_only = ccode_only;
 		context.compile_only = compile_only;

Modified: trunk/vala/valasourcefile.vala
==============================================================================
--- trunk/vala/valasourcefile.vala	(original)
+++ trunk/vala/valasourcefile.vala	Thu May 29 21:03:38 2008
@@ -185,6 +185,10 @@
 		return Path.get_basename (filename.substring (0, dot));
 	}
 
+	public string get_relative_filename () {
+		return get_subdir () + Path.get_basename (filename);
+	}
+
 	/**
 	 * Returns the filename to use when generating C header files.
 	 *

Modified: trunk/vala/valasourcereference.vala
==============================================================================
--- trunk/vala/valasourcereference.vala	(original)
+++ trunk/vala/valasourcereference.vala	Thu May 29 21:03:38 2008
@@ -100,6 +100,6 @@
 	 * @return human-readable string
 	 */
 	public string to_string () {
-		return ("%s:%d.%d-%d.%d".printf (file.filename, first_line, first_column, last_line, last_column));
+		return ("%s:%d.%d-%d.%d".printf (file.get_relative_filename (), first_line, first_column, last_line, last_column));
 	}
 }



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