From c1d27c7770be8bc96231674f57905e1117dd6bdd Mon Sep 17 00:00:00 2001 From: Alex Lyman Date: Mon, 13 Jun 2011 21:42:14 -0700 Subject: [PATCH] - 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 --- .../CSharp/OutputVisitor/OutputVisitor.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index da524257d0..8e33190067 100644 --- a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -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) {