diff options
author | Mike Mazur | 2008-07-31 01:27:33 +0000 |
---|---|---|
committer | Mike Mazur | 2008-07-31 01:27:33 +0000 |
commit | eef386427863e27a40cb22a424ddb5ceeb6c7a56 (patch) | |
tree | 331ca69428a9ece47d412556a366839f76ffded2 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |
parent | More LSL_Types implicit/explicit cast changes. Fix issue 1854. (diff) | |
download | opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.zip opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.gz opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.bz2 opensim-SC-eef386427863e27a40cb22a424ddb5ceeb6c7a56.tar.xz |
Fix issue 1860; exception thrown in the parser on if/if-else/for/while/do-while
statements with no body.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 3bdad4d..2226673 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -388,14 +388,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
388 | private string GenerateStatement(Statement s) | 388 | private string GenerateStatement(Statement s) |
389 | { | 389 | { |
390 | string retstr = String.Empty; | 390 | string retstr = String.Empty; |
391 | 391 | bool printSemicolon = true; | |
392 | // Jump label prints its own colon, we don't need a semicolon. | ||
393 | bool printSemicolon = !(s.kids.Top is JumpLabel); | ||
394 | 392 | ||
395 | retstr += Indent(); | 393 | retstr += Indent(); |
396 | 394 | ||
397 | foreach (SYMBOL kid in s.kids) | 395 | if (0 < s.kids.Count) |
398 | retstr += GenerateNode(kid); | 396 | { |
397 | // Jump label prints its own colon, we don't need a semicolon. | ||
398 | printSemicolon = !(s.kids.Top is JumpLabel); | ||
399 | |||
400 | foreach (SYMBOL kid in s.kids) | ||
401 | retstr += GenerateNode(kid); | ||
402 | } | ||
399 | 403 | ||
400 | if (printSemicolon) | 404 | if (printSemicolon) |
401 | retstr += GenerateLine(";"); | 405 | retstr += GenerateLine(";"); |