Thanks Tommi Laukkanen for a patch that allows the
CSCodeGeneratorTest.TestStringsWithEscapedQuotesAndComments unit test to pass on Windows. Fixes Mantis #3104.0.6.3-post-fixes
parent
d01fffb8b5
commit
9a33a4733e
|
@ -145,6 +145,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
m_braceCount--;
|
m_braceCount--;
|
||||||
//retstr += GenerateLine("}");
|
//retstr += GenerateLine("}");
|
||||||
|
|
||||||
|
// Removes all carriage return characters which may be generated in Windows platform. Is there
|
||||||
|
// cleaner way of doing this?
|
||||||
|
retstr=retstr.Replace("\r", "");
|
||||||
|
|
||||||
return retstr;
|
return retstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +715,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
{
|
{
|
||||||
string retstr = String.Empty;
|
string retstr = String.Empty;
|
||||||
|
|
||||||
// we wrap all typecasted statements in parentheses
|
// we wrap all typecasted statements in parentheses
|
||||||
retstr += Generate(String.Format("({0}) (", te.TypecastType), te);
|
retstr += Generate(String.Format("({0}) (", te.TypecastType), te);
|
||||||
retstr += GenerateNode((SYMBOL) te.kids.Pop());
|
retstr += GenerateNode((SYMBOL) te.kids.Pop());
|
||||||
retstr += Generate(")");
|
retstr += Generate(")");
|
||||||
|
@ -972,12 +976,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the passed name with an underscore prepended if that name is a reserved word in C#
|
/// Returns the passed name with an underscore prepended if that name is a reserved word in C#
|
||||||
/// and not resevered in LSL otherwise it just returns the passed name.
|
/// and not resevered in LSL otherwise it just returns the passed name.
|
||||||
///
|
///
|
||||||
/// This makes no attempt to cache the results to minimise future lookups. For a non trivial
|
/// This makes no attempt to cache the results to minimise future lookups. For a non trivial
|
||||||
/// scripts the number of unique identifiers could easily grow to the size of the reserved word
|
/// scripts the number of unique identifiers could easily grow to the size of the reserved word
|
||||||
/// list so maintaining a list or dictionary and doing the lookup there firstwould probably not
|
/// list so maintaining a list or dictionary and doing the lookup there firstwould probably not
|
||||||
/// give any real speed advantage.
|
/// give any real speed advantage.
|
||||||
///
|
///
|
||||||
/// I believe there is a class Microsoft.CSharp.CSharpCodeProvider that has a function
|
/// I believe there is a class Microsoft.CSharp.CSharpCodeProvider that has a function
|
||||||
/// CreateValidIdentifier(str) that will return either the value of str if it is not a C#
|
/// CreateValidIdentifier(str) that will return either the value of str if it is not a C#
|
||||||
/// key word or "_"+str if it is. But availability under Mono?
|
/// key word or "_"+str if it is. But availability under Mono?
|
||||||
|
|
Loading…
Reference in New Issue