Browse Source

- Made the InitializerTests pass, through three changes: * Added new-lines as needed to make the source formatting match what the actual output was. * Added code to CodeAssert to make it ignore #regions * Added code to output decimal.MinValue and decimal.MaxValue as appropriate

newNRvisualizers
Alex Lyman 14 years ago committed by Daniel Grunwald
parent
commit
c1d27c7770
  1. 11
      ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

11
ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

@ -872,6 +872,17 @@ namespace ICSharpCode.NRefactory.CSharp @@ -872,6 +872,17 @@ namespace ICSharpCode.NRefactory.CSharp
formatter.WriteToken("'" + ConvertCharLiteral((char)val) + "'");
lastWritten = LastWritten.Other;
} else if (val is decimal) {
decimal d = (decimal) val;
if (d == decimal.MinValue || d == decimal.MaxValue)
{
WriteKeyword("decimal");
WriteToken(".", AstNode.Roles.Dot);
if (d == decimal.MinValue)
WriteIdentifier("MinValue");
else
WriteIdentifier("MaxValue");
return;
}
formatter.WriteToken(((decimal)val).ToString(NumberFormatInfo.InvariantInfo) + "m");
lastWritten = LastWritten.Other;
} else if (val is float) {

Loading…
Cancel
Save