From 8f133cb46b405988c89a708027cd1748dc87ce7c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 18 Sep 2009 19:28:58 -0700 Subject: Renamed the project lslc to OpenSim.Tools.lslc to conform to the naming conventions so far. Added copyright to it. --- OpenSim/Tools/Compiler/Program.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Tools') diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs index 0141f48..9cd6bc8 100644 --- a/OpenSim/Tools/Compiler/Program.cs +++ b/OpenSim/Tools/Compiler/Program.cs @@ -1,3 +1,29 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ using System; using System.Collections.Generic; -- cgit v1.1 From f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 29 Sep 2009 08:32:59 +0900 Subject: Add copyright header. Formatting cleanup. --- OpenSim/Tools/Compiler/Program.cs | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'OpenSim/Tools') 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 class Program { private static Dictionary, KeyValuePair> m_positionMap; - private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); + private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); static void Main(string[] args) { - string source = null; + string source = null; - if(args.Length == 0) + if (args.Length == 0) { Console.WriteLine("No input file specified"); Environment.Exit(1); } - if(!File.Exists(args[0])) + if (!File.Exists(args[0])) { Console.WriteLine("Input file does not exist"); Environment.Exit(1); @@ -136,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler string errtext = String.Empty; foreach (CompilerError CompErr in results.Errors) { - string severity = "Error"; - if ( CompErr.IsWarning ) - { - severity = "Warning"; - } + string severity = CompErr.IsWarning ? "Warning" : "Error"; KeyValuePair lslPos; @@ -153,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler // The Second Life viewer's script editor begins // countingn lines and columns at 0, so we subtract 1. errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", - lslPos.Key - 1, lslPos.Value - 1, - CompErr.ErrorNumber, text, severity); + lslPos.Key - 1, lslPos.Value - 1, + CompErr.ErrorNumber, text, severity); } disp = "Completed with errors"; @@ -237,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler private static string ReplaceTypes(string message) { message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", - "string"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", + "string"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", - "integer"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", + "integer"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", - "float"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", + "float"); message = message.Replace( - "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", - "list"); + "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", + "list"); return message; } @@ -263,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler private class kvpSorter : IComparer> { public int Compare(KeyValuePair a, - KeyValuePair b) + KeyValuePair b) { return a.Key.CompareTo(b.Key); } -- cgit v1.1