aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine
diff options
context:
space:
mode:
authorJeff Ames2008-05-18 23:06:50 +0000
committerJeff Ames2008-05-18 23:06:50 +0000
commit6ec680918bc6876f1c1382fb534b653fc34da052 (patch)
tree7eedbb3fa05b9540de9bba4a583795f1ba919de4 /OpenSim/Region/ScriptEngine/DotNetEngine
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.zip
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.gz
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.bz2
opensim-SC_OLD-6ec680918bc6876f1c1382fb534b653fc34da052.tar.xz
Formatting cleanup, minor refactoring. Fixed some comparisons of value types and null.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs15
1 files changed, 3 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 2469107..765eb5d 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -39,13 +39,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
39 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); 39 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled);
40 private Dictionary<string, string> dataTypes = new Dictionary<string, string>(); 40 private Dictionary<string, string> dataTypes = new Dictionary<string, string>();
41 private Dictionary<string, string> quotes = new Dictionary<string, string>(); 41 private Dictionary<string, string> quotes = new Dictionary<string, string>();
42 // c Style 42 // c Style
43 private Regex cstylecomments = new Regex(@"/\*(.|[\r\n])*?\*/", RegexOptions.Compiled | RegexOptions.Multiline); 43 private Regex cstylecomments = new Regex(@"/\*(.|[\r\n])*?\*/", RegexOptions.Compiled | RegexOptions.Multiline);
44 // c# one liners 44 // c# one liners
45 private Regex conelinecomments = new Regex(@".?([\/]{2}[^\n]*)|([\n]{1,}[\/]{2}[^\n]*)", RegexOptions.Compiled | RegexOptions.Multiline); 45 private Regex conelinecomments = new Regex(@".?([\/]{2}[^\n]*)|([\n]{1,}[\/]{2}[^\n]*)", RegexOptions.Compiled | RegexOptions.Multiline);
46 // ([^\"])((?:[a-zA-Z])\.[a-zA-Z].?)([^\"]) 46 // ([^\"])((?:[a-zA-Z])\.[a-zA-Z].?)([^\"])
47
48
49 47
50 // value we're looking for: (?:[a-zA-Z])\.[a-zA-Z] 48 // value we're looking for: (?:[a-zA-Z])\.[a-zA-Z]
51 public LSL2CSConverter() 49 public LSL2CSConverter()
@@ -89,16 +87,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
89 bool last_was_escape = false; 87 bool last_was_escape = false;
90 int quote_replaced_count = 0; 88 int quote_replaced_count = 0;
91 89
92
93
94 string removecomments = conelinecomments.Replace(Script, ""); 90 string removecomments = conelinecomments.Replace(Script, "");
95 removecomments = cstylecomments.Replace(removecomments, ""); 91 removecomments = cstylecomments.Replace(removecomments, "");
96 string[] localscript = removecomments.Split('"'); 92 string[] localscript = removecomments.Split('"');
97 string checkscript = String.Empty; 93 string checkscript = String.Empty;
98 bool flip = true; 94 bool flip = true;
99 95
100
101
102 for (int p = 0; p < localscript.Length; p++) 96 for (int p = 0; p < localscript.Length; p++)
103 { 97 {
104 if (localscript[p].Length >= 1) 98 if (localscript[p].Length >= 1)
@@ -115,7 +109,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
115 if (!flip) 109 if (!flip)
116 checkscript += "\"" + localscript[p]; 110 checkscript += "\"" + localscript[p];
117 } 111 }
118 112
119 //System.Console.WriteLine("SCRIPT:" + checkscript); 113 //System.Console.WriteLine("SCRIPT:" + checkscript);
120 114
121 // checks for alpha.alpha way of referring to objects in C# 115 // checks for alpha.alpha way of referring to objects in C#
@@ -132,9 +126,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
132 if (SecurityM.Success) 126 if (SecurityM.Success)
133 throw new Exception("CS0103: 'The object.GetType method isn't allowed in LSL'"); 127 throw new Exception("CS0103: 'The object.GetType method isn't allowed in LSL'");
134 128
135
136
137
138 for (int p = 0; p < Script.Length; p++) 129 for (int p = 0; p < Script.Length; p++)
139 { 130 {
140 C = Script.Substring(p, 1); 131 C = Script.Substring(p, 1);