aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
diff options
context:
space:
mode:
authorCharles Krinke2009-02-23 02:43:51 +0000
committerCharles Krinke2009-02-23 02:43:51 +0000
commit08c76989a719803e4cb7c5391bc864046bba31f2 (patch)
treeb62e6288ba9ce024a5020d0f302a059e44ba457e /OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
parentA little bit more tweaking with appearance. Now passing both the wearables an... (diff)
downloadopensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.zip
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.gz
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.bz2
opensim-SC_OLD-08c76989a719803e4cb7c5391bc864046bba31f2.tar.xz
Mantis#3187. Thank you kindly, DoranZemlja for a patch that:
Adds a warning for an LSL construct that exploits a popular list memory saving hack.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 03b2ab3..59d862d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -76,6 +76,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
76 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; 76 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
77 private ICodeConverter LSL_Converter; 77 private ICodeConverter LSL_Converter;
78 78
79 private List<string> m_warnings = new List<string>();
80
79 // private object m_syncy = new object(); 81 // private object m_syncy = new object();
80 82
81 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 83 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
@@ -336,6 +338,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
336 LSL_Converter = (ICodeConverter)new CSCodeGenerator(); 338 LSL_Converter = (ICodeConverter)new CSCodeGenerator();
337 compileScript = LSL_Converter.Convert(Script); 339 compileScript = LSL_Converter.Convert(Script);
338 340
341 // copy converter warnings into our warnings.
342 foreach(string warning in LSL_Converter.GetWarnings())
343 {
344 AddWarning(warning);
345 }
346
339 m_positionMap = ((CSCodeGenerator) LSL_Converter).PositionMap; 347 m_positionMap = ((CSCodeGenerator) LSL_Converter).PositionMap;
340 } 348 }
341 349
@@ -373,6 +381,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
373 return CompileFromDotNetText(compileScript, l, asset); 381 return CompileFromDotNetText(compileScript, l, asset);
374 } 382 }
375 383
384 public string[] GetWarnings()
385 {
386 return m_warnings.ToArray();
387 }
388
389 private void AddWarning(string warning)
390 {
391 if (!m_warnings.Contains(warning))
392 {
393 m_warnings.Add(warning);
394 }
395 }
396
376 private static string CreateJSCompilerScript(string compileScript) 397 private static string CreateJSCompilerScript(string compileScript)
377 { 398 {
378 compileScript = String.Empty + 399 compileScript = String.Empty +