From fda5457996ec1b5862af228d765c6d462550e5c1 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 29 Aug 2008 19:57:01 +0000 Subject: [PATCH] Maintis #2078 Thank you, ralphos, for a patch that corrects the handling of compiler warnings in the XEngine, which were erronoeously reported as errors! --- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index db90f3e4e9..6028179e08 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -543,6 +543,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools string errtext = String.Empty; foreach (CompilerError CompErr in results.Errors) { + string severity = "Error"; + if ( CompErr.IsWarning ) + { + severity = "Warning"; + } + if (m_UseCompiler) { KeyValuePair lslPos; @@ -559,16 +565,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // The Second Life viewer's script editor begins // countingn lines and columns at 0, so we subtract 1. - errtext += String.Format("Line {0}, column {1}, Error Number: {2}, '{3}'\r\n", lslPos.Key - 1, lslPos.Value - 1, CompErr.ErrorNumber, CompErr.ErrorText); + errtext += String.Format("Line {0}, column {1}, {4} Number: {2}, '{3}'\r\n", lslPos.Key - 1, lslPos.Value - 1, CompErr.ErrorNumber, CompErr.ErrorText, severity); + } else { errtext += "Line number " + (CompErr.Line - LinesToRemoveOnError) + - ", Error Number: " + CompErr.ErrorNumber + + ", " + severity + " Number: " + CompErr.ErrorNumber + ", '" + CompErr.ErrorText + "'\r\n"; } } - Console.WriteLine("[COMPILER ERROR]:" + errtext); + Console.WriteLine("[COMPILER MESSAGES]: " + errtext); if (!File.Exists(OutFile)) { throw new Exception(errtext);