mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
Fix issue 1860; exception thrown in the parser on if/if-else/for/while/do-while
statements with no body.
This commit is contained in:
@@ -388,14 +388,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
|
||||
private string GenerateStatement(Statement s)
|
||||
{
|
||||
string retstr = String.Empty;
|
||||
|
||||
// Jump label prints its own colon, we don't need a semicolon.
|
||||
bool printSemicolon = !(s.kids.Top is JumpLabel);
|
||||
bool printSemicolon = true;
|
||||
|
||||
retstr += Indent();
|
||||
|
||||
foreach (SYMBOL kid in s.kids)
|
||||
retstr += GenerateNode(kid);
|
||||
if (0 < s.kids.Count)
|
||||
{
|
||||
// Jump label prints its own colon, we don't need a semicolon.
|
||||
printSemicolon = !(s.kids.Top is JumpLabel);
|
||||
|
||||
foreach (SYMBOL kid in s.kids)
|
||||
retstr += GenerateNode(kid);
|
||||
}
|
||||
|
||||
if (printSemicolon)
|
||||
retstr += GenerateLine(";");
|
||||
|
||||
Reference in New Issue
Block a user