diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 86d6188..e8f2b71 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -89,7 +89,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
89 | ResetCounters(); | 89 | ResetCounters(); |
90 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); | 90 | Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); |
91 | // Obviously this needs to be in a try/except block. | 91 | // Obviously this needs to be in a try/except block. |
92 | LSL2CSCodeTransformer codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | 92 | LSL2CSCodeTransformer codeTransformer; |
93 | try | ||
94 | { | ||
95 | codeTransformer = new LSL2CSCodeTransformer(p.Parse(script)); | ||
96 | } | ||
97 | catch (CSToolsException e) | ||
98 | { | ||
99 | string message; | ||
100 | |||
101 | // LL start numbering lines at 0 - geeks! | ||
102 | // | ||
103 | message = String.Format("Line ({0},{1}) {2}", | ||
104 | e.slInfo.lineNumber - 1, | ||
105 | e.slInfo.charPosition - 1, e.Message); | ||
106 | |||
107 | throw new Exception(message); | ||
108 | } | ||
109 | |||
93 | m_astRoot = codeTransformer.Transform(); | 110 | m_astRoot = codeTransformer.Transform(); |
94 | 111 | ||
95 | string retstr = String.Empty; | 112 | string retstr = String.Empty; |