diff options
author | John Hurliman | 2009-09-30 15:28:23 -0700 |
---|---|---|
committer | John Hurliman | 2009-09-30 15:28:23 -0700 |
commit | acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009 (patch) | |
tree | 305349e1bd0a5849fd7f96483e24d5e07b24b8f4 /OpenSim/Tools/Compiler | |
parent | * Adding Scale to EntityBase * Fixing the incorrect initialization of EntityB... (diff) | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.zip opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.gz opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.bz2 opensim-SC_OLD-acfe2d9f4e5a55d38b16cac7d0d0a25b64b6b009.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Tools/Compiler')
-rw-r--r-- | OpenSim/Tools/Compiler/Program.cs | 62 |
1 files changed, 42 insertions, 20 deletions
diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs index 0141f48..b18e029 100644 --- a/OpenSim/Tools/Compiler/Program.cs +++ b/OpenSim/Tools/Compiler/Program.cs | |||
@@ -1,3 +1,29 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
1 | 27 | ||
2 | using System; | 28 | using System; |
3 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
@@ -11,19 +37,19 @@ namespace OpenSim.Tools.LSL.Compiler | |||
11 | class Program | 37 | class Program |
12 | { | 38 | { |
13 | private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; | 39 | private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; |
14 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); | 40 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); |
15 | 41 | ||
16 | static void Main(string[] args) | 42 | static void Main(string[] args) |
17 | { | 43 | { |
18 | string source = null; | 44 | string source = null; |
19 | 45 | ||
20 | if(args.Length == 0) | 46 | if (args.Length == 0) |
21 | { | 47 | { |
22 | Console.WriteLine("No input file specified"); | 48 | Console.WriteLine("No input file specified"); |
23 | Environment.Exit(1); | 49 | Environment.Exit(1); |
24 | } | 50 | } |
25 | 51 | ||
26 | if(!File.Exists(args[0])) | 52 | if (!File.Exists(args[0])) |
27 | { | 53 | { |
28 | Console.WriteLine("Input file does not exist"); | 54 | Console.WriteLine("Input file does not exist"); |
29 | Environment.Exit(1); | 55 | Environment.Exit(1); |
@@ -110,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler | |||
110 | string errtext = String.Empty; | 136 | string errtext = String.Empty; |
111 | foreach (CompilerError CompErr in results.Errors) | 137 | foreach (CompilerError CompErr in results.Errors) |
112 | { | 138 | { |
113 | string severity = "Error"; | 139 | string severity = CompErr.IsWarning ? "Warning" : "Error"; |
114 | if ( CompErr.IsWarning ) | ||
115 | { | ||
116 | severity = "Warning"; | ||
117 | } | ||
118 | 140 | ||
119 | KeyValuePair<int, int> lslPos; | 141 | KeyValuePair<int, int> lslPos; |
120 | 142 | ||
@@ -127,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler | |||
127 | // The Second Life viewer's script editor begins | 149 | // The Second Life viewer's script editor begins |
128 | // countingn lines and columns at 0, so we subtract 1. | 150 | // countingn lines and columns at 0, so we subtract 1. |
129 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", | 151 | errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", |
130 | lslPos.Key - 1, lslPos.Value - 1, | 152 | lslPos.Key - 1, lslPos.Value - 1, |
131 | CompErr.ErrorNumber, text, severity); | 153 | CompErr.ErrorNumber, text, severity); |
132 | } | 154 | } |
133 | 155 | ||
134 | disp = "Completed with errors"; | 156 | disp = "Completed with errors"; |
@@ -211,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler | |||
211 | private static string ReplaceTypes(string message) | 233 | private static string ReplaceTypes(string message) |
212 | { | 234 | { |
213 | message = message.Replace( | 235 | message = message.Replace( |
214 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", | 236 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", |
215 | "string"); | 237 | "string"); |
216 | 238 | ||
217 | message = message.Replace( | 239 | message = message.Replace( |
218 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", | 240 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", |
219 | "integer"); | 241 | "integer"); |
220 | 242 | ||
221 | message = message.Replace( | 243 | message = message.Replace( |
222 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", | 244 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", |
223 | "float"); | 245 | "float"); |
224 | 246 | ||
225 | message = message.Replace( | 247 | message = message.Replace( |
226 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", | 248 | "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", |
227 | "list"); | 249 | "list"); |
228 | 250 | ||
229 | return message; | 251 | return message; |
230 | } | 252 | } |
@@ -237,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler | |||
237 | private class kvpSorter : IComparer<KeyValuePair<int,int>> | 259 | private class kvpSorter : IComparer<KeyValuePair<int,int>> |
238 | { | 260 | { |
239 | public int Compare(KeyValuePair<int,int> a, | 261 | public int Compare(KeyValuePair<int,int> a, |
240 | KeyValuePair<int,int> b) | 262 | KeyValuePair<int,int> b) |
241 | { | 263 | { |
242 | return a.Key.CompareTo(b.Key); | 264 | return a.Key.CompareTo(b.Key); |
243 | } | 265 | } |