diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | 21 |
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 + |