diff options
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Tools')
-rw-r--r-- | OpenSim/Tools/Compiler/Program.cs | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs index 9cd6bc8..b18e029 100644 --- a/OpenSim/Tools/Compiler/Program.cs +++ b/OpenSim/Tools/Compiler/Program.cs | |||
@@ -37,19 +37,19 @@ namespace OpenSim.Tools.LSL.Compiler | |||
37 | class Program | 37 | class Program |
38 | { | 38 | { |
39 | private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; | 39 | private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; |
40 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); | 40 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); |
41 | 41 | ||
42 | static void Main(string[] args) | 42 | static void Main(string[] args) |
43 | { | 43 | { |
44 | string source = null; | 44 | string source = null; |
45 | 45 | ||
46 | if(args.Length == 0) | 46 | if (args.Length == 0) |
47 | { | 47 | { |
48 | Console.WriteLine("No input file specified"); | 48 | Console.WriteLine("No input file specified"); |
49 | Environment.Exit(1); | 49 | Environment.Exit(1); |
50 | } | 50 | } |
51 | 51 | ||
52 | if(!File.Exists(args[0])) | 52 | if (!File.Exists(args[0])) |
53 | { | 53 | { |
54 | Console.WriteLine("Input file does not exist"); | 54 | Console.WriteLine("Input file does not exist"); |
55 | Environment.Exit(1); | 55 | Environment.Exit(1); |
@@ -136,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler | |||
136 | string errtext = String.Empty; | 136 | string errtext = String.Empty; |
137 | foreach (CompilerError CompErr in results.Errors) | 137 | foreach (CompilerError CompErr in results.Errors) |
138 | { | 138 | { |
139 | string severity = "Error"; | 139 | string severity = CompErr.IsWarning ? "Warning" : "Error"; |
140 | if ( CompErr.IsWarning ) | ||
141 | { | ||
142 | severity = "Warning"; | ||
143 | } | ||
144 | 140 | ||
145 | KeyValuePair<int, int> lslPos; | 141 | KeyValuePair<int, int> lslPos; |
146 | 142 | ||
@@ -153,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler | |||
153 | // The Second Life viewer's script editor begins | 149 | // The Second Life viewer's script editor begins |
154 | // countingn lines and columns at 0, so we subtract 1. | 150 | // countingn lines and columns at 0, so we subtract 1. |
155 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", | 151 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", |
156 | lslPos.Key - 1, lslPos.Value - 1, | 152 | lslPos.Key - 1, lslPos.Value - 1, |
157 | CompErr.ErrorNumber, text, severity); | 153 | CompErr.ErrorNumber, text, severity); |
158 | } | 154 | } |
159 | 155 | ||
160 | disp = "Completed with errors"; | 156 | disp = "Completed with errors"; |
@@ -237,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler | |||
237 | private static string ReplaceTypes(string message) | 233 | private static string ReplaceTypes(string message) |
238 | { | 234 | { |
239 | message = message.Replace( | 235 | message = message.Replace( |
240 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", | 236 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", |
241 | "string"); | 237 | "string"); |
242 | 238 | ||
243 | message = message.Replace( | 239 | message = message.Replace( |
244 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", | 240 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", |
245 | "integer"); | 241 | "integer"); |
246 | 242 | ||
247 | message = message.Replace( | 243 | message = message.Replace( |
248 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", | 244 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", |
249 | "float"); | 245 | "float"); |
250 | 246 | ||
251 | message = message.Replace( | 247 | message = message.Replace( |
252 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", | 248 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", |
253 | "list"); | 249 | "list"); |
254 | 250 | ||
255 | return message; | 251 | return message; |
256 | } | 252 | } |
@@ -263,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler | |||
263 | private class kvpSorter : IComparer<KeyValuePair<int,int>> | 259 | private class kvpSorter : IComparer<KeyValuePair<int,int>> |
264 | { | 260 | { |
265 | public int Compare(KeyValuePair<int,int> a, | 261 | public int Compare(KeyValuePair<int,int> a, |
266 | KeyValuePair<int,int> b) | 262 | KeyValuePair<int,int> b) |
267 | { | 263 | { |
268 | return a.Key.CompareTo(b.Key); | 264 | return a.Key.CompareTo(b.Key); |
269 | } | 265 | } |