diff options
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 41ecfd3..e427f50 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -722,8 +722,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
722 | if (fls.kids.Top is IdentExpression && 1 == fls.kids.Count) | 722 | if (fls.kids.Top is IdentExpression && 1 == fls.kids.Count) |
723 | return retstr; | 723 | return retstr; |
724 | 724 | ||
725 | foreach (SYMBOL s in fls.kids) | 725 | for (int i = 0; i < fls.kids.Count; i++) |
726 | { | 726 | { |
727 | SYMBOL s = (SYMBOL)fls.kids[i]; | ||
728 | |||
729 | // Statements surrounded by parentheses in for loops | ||
730 | // | ||
731 | // e.g. for ((i = 0), (j = 7); (i < 10); (++i)) | ||
732 | // | ||
733 | // are legal in LSL but not in C# so we need to discard the parentheses | ||
734 | // | ||
735 | // The following, however, does not appear to be legal in LLS | ||
736 | // | ||
737 | // for ((i = 0, j = 7); (i < 10); (++i)) | ||
738 | // | ||
739 | // As of Friday 20th November 2009, the Linden Lab simulators appear simply never to compile or run this | ||
740 | // script but with no debug or warnings at all! Therefore, we won't deal with this yet (which looks | ||
741 | // like it would be considerably more complicated to handle). | ||
742 | while (s is ParenthesisExpression) | ||
743 | s = (SYMBOL)s.kids.Pop(); | ||
744 | |||
727 | retstr += GenerateNode(s); | 745 | retstr += GenerateNode(s); |
728 | if (0 < comma--) | 746 | if (0 < comma--) |
729 | retstr += Generate(", "); | 747 | retstr += Generate(", "); |