diff options
author | Mike Mazur | 2009-02-09 00:59:02 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-09 00:59:02 +0000 |
commit | 9a33a4733ef02fc6c5b8b9887173855f37a47638 (patch) | |
tree | 6720ad35789356d92c90027a40bc6d3d97a8e105 /OpenSim/Region/ScriptEngine | |
parent | Remove unused OpenSim/Data/{DataStore,InventoryData}Base.cs. (diff) | |
download | opensim-SC-9a33a4733ef02fc6c5b8b9887173855f37a47638.zip opensim-SC-9a33a4733ef02fc6c5b8b9887173855f37a47638.tar.gz opensim-SC-9a33a4733ef02fc6c5b8b9887173855f37a47638.tar.bz2 opensim-SC-9a33a4733ef02fc6c5b8b9887173855f37a47638.tar.xz |
Thanks Tommi Laukkanen for a patch that allows the
CSCodeGeneratorTest.TestStringsWithEscapedQuotesAndComments unit test to
pass on Windows. Fixes Mantis #3104.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 37d29f7..f9ab97b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | |||
@@ -145,6 +145,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
145 | m_braceCount--; | 145 | m_braceCount--; |
146 | //retstr += GenerateLine("}"); | 146 | //retstr += GenerateLine("}"); |
147 | 147 | ||
148 | // Removes all carriage return characters which may be generated in Windows platform. Is there | ||
149 | // cleaner way of doing this? | ||
150 | retstr=retstr.Replace("\r", ""); | ||
151 | |||
148 | return retstr; | 152 | return retstr; |
149 | } | 153 | } |
150 | 154 | ||
@@ -711,7 +715,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
711 | { | 715 | { |
712 | string retstr = String.Empty; | 716 | string retstr = String.Empty; |
713 | 717 | ||
714 | // we wrap all typecasted statements in parentheses | 718 | // we wrap all typecasted statements in parentheses |
715 | retstr += Generate(String.Format("({0}) (", te.TypecastType), te); | 719 | retstr += Generate(String.Format("({0}) (", te.TypecastType), te); |
716 | retstr += GenerateNode((SYMBOL) te.kids.Pop()); | 720 | retstr += GenerateNode((SYMBOL) te.kids.Pop()); |
717 | retstr += Generate(")"); | 721 | retstr += Generate(")"); |
@@ -972,12 +976,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
972 | /// <summary> | 976 | /// <summary> |
973 | /// Returns the passed name with an underscore prepended if that name is a reserved word in C# | 977 | /// Returns the passed name with an underscore prepended if that name is a reserved word in C# |
974 | /// and not resevered in LSL otherwise it just returns the passed name. | 978 | /// and not resevered in LSL otherwise it just returns the passed name. |
975 | /// | 979 | /// |
976 | /// This makes no attempt to cache the results to minimise future lookups. For a non trivial | 980 | /// This makes no attempt to cache the results to minimise future lookups. For a non trivial |
977 | /// scripts the number of unique identifiers could easily grow to the size of the reserved word | 981 | /// scripts the number of unique identifiers could easily grow to the size of the reserved word |
978 | /// list so maintaining a list or dictionary and doing the lookup there firstwould probably not | 982 | /// list so maintaining a list or dictionary and doing the lookup there firstwould probably not |
979 | /// give any real speed advantage. | 983 | /// give any real speed advantage. |
980 | /// | 984 | /// |
981 | /// I believe there is a class Microsoft.CSharp.CSharpCodeProvider that has a function | 985 | /// I believe there is a class Microsoft.CSharp.CSharpCodeProvider that has a function |
982 | /// CreateValidIdentifier(str) that will return either the value of str if it is not a C# | 986 | /// CreateValidIdentifier(str) that will return either the value of str if it is not a C# |
983 | /// key word or "_"+str if it is. But availability under Mono? | 987 | /// key word or "_"+str if it is. But availability under Mono? |