diff options
author | Mike Mazur | 2009-02-20 07:40:36 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-20 07:40:36 +0000 |
commit | a42499c947e350639da81f0e8930eae5d331c441 (patch) | |
tree | 13a8449de17fb2e50e4395acfb852091bbabb4a2 /OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |
parent | Update TESTING.txt. Mantis #3174. (diff) | |
download | opensim-SC-a42499c947e350639da81f0e8930eae5d331c441.zip opensim-SC-a42499c947e350639da81f0e8930eae5d331c441.tar.gz opensim-SC-a42499c947e350639da81f0e8930eae5d331c441.tar.bz2 opensim-SC-a42499c947e350639da81f0e8930eae5d331c441.tar.xz |
Thanks DoranZemlja for a patch implementing non-shortcircuiting in
logical and and logical or in LSL. Fixes Mantis #3174.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index f9ab97b..71e88e3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -646,10 +646,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
646 | { | 646 | { |
647 | string retstr = String.Empty; | 647 | string retstr = String.Empty; |
648 | 648 | ||
649 | retstr += GenerateNode((SYMBOL) be.kids.Pop()); | 649 | if (be.ExpressionSymbol.Equals("&&") || be.ExpressionSymbol.Equals("||")) |
650 | retstr += Generate(String.Format(" {0} ", be.ExpressionSymbol), be); | 650 | { |
651 | foreach (SYMBOL kid in be.kids) | 651 | // special case handling for logical and/or, see Mantis 3174 |
652 | retstr += GenerateNode(kid); | 652 | retstr += "((bool)("; |
653 | retstr += GenerateNode((SYMBOL)be.kids.Pop()); | ||
654 | retstr += "))"; | ||
655 | retstr += Generate(String.Format(" {0} ", be.ExpressionSymbol.Substring(0,1)), be); | ||
656 | retstr += "((bool)("; | ||
657 | foreach (SYMBOL kid in be.kids) | ||
658 | retstr += GenerateNode(kid); | ||
659 | retstr += "))"; | ||
660 | } | ||
661 | else | ||
662 | { | ||
663 | retstr += GenerateNode((SYMBOL)be.kids.Pop()); | ||
664 | retstr += Generate(String.Format(" {0} ", be.ExpressionSymbol), be); | ||
665 | foreach (SYMBOL kid in be.kids) | ||
666 | retstr += GenerateNode(kid); | ||
667 | } | ||
653 | 668 | ||
654 | return retstr; | 669 | return retstr; |
655 | } | 670 | } |