From f68a49b509ccfd8f564814911cfb1ccd1eaa4d73 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 15 Mar 2011 04:01:17 +0100 Subject: [PATCH] Improve spacing in fixed statement output. --- ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs | 2 ++ ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs index ce8ad9879c..b888cdea23 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs @@ -55,6 +55,8 @@ namespace ICSharpCode.NRefactory.CSharp return GetChildrenByRole(PointerRole).Count(); } set { + if (value < 0) + throw new ArgumentOutOfRangeException(); int d = this.PointerRank; while (d > value) { GetChildByRole(PointerRole).Remove(); diff --git a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index f12d3ffac8..da843f39cc 100644 --- a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -1387,9 +1387,13 @@ namespace ICSharpCode.NRefactory.CSharp { StartNode(fixedStatement); WriteKeyword("fixed"); + Space(policy.UsingParentheses); LPar(); + Space(policy.WithinUsingParentheses); fixedStatement.Type.AcceptVisitor(this, data); + Space(); WriteCommaSeparatedList(fixedStatement.Variables); + Space(policy.WithinUsingParentheses); RPar(); WriteEmbeddedStatement(fixedStatement.EmbeddedStatement); return EndNode(fixedStatement);