Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@novell.com>2009-03-16 10:13:27 +0300
committerMike Krüger <mkrueger@novell.com>2009-03-16 10:13:27 +0300
commit8ba00764cd8db50d7b3dcdc93dcc3d36b91d0a90 (patch)
tree3f8a12af6715c316e9e57f87b74540604e54f2c6 /main/contrib
parentdaa3e70403dbdf124e17e44a384f9c3dc718d87f (diff)
* Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: fixed bracket
output issues. svn path=/trunk/monodevelop/; revision=129400
Diffstat (limited to 'main/contrib')
-rw-r--r--main/contrib/NRefactory/Project/ChangeLog5
-rw-r--r--main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs12
2 files changed, 12 insertions, 5 deletions
diff --git a/main/contrib/NRefactory/Project/ChangeLog b/main/contrib/NRefactory/Project/ChangeLog
index 0a04b979cc..2c9b24a547 100644
--- a/main/contrib/NRefactory/Project/ChangeLog
+++ b/main/contrib/NRefactory/Project/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-16 Mike Krüger <mkrueger@novell.com>
+
+ * Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs: fixed
+ bracket output issues.
+
2009-03-15 Mike Krüger <mkrueger@novell.com>
* Src/PrettyPrinter/CSharp/OutputFormatter.cs:
diff --git a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
index f6af31f9d0..1b36676ed8 100644
--- a/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
+++ b/main/contrib/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
@@ -2,7 +2,7 @@
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
-// <version>$Revision: 3850 $</version>
+// <version>$Revision: 3854 $</version>
// </file>
using System;
@@ -142,13 +142,14 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
{
for (int i = startRankIndex; i < rankSpecifier.Length; ++i) {
outputFormatter.PrintToken(Tokens.OpenSquareBracket);
- if (this.prettyPrintOptions.SpacesWithinBrackets) {
+ bool outputSpace = this.prettyPrintOptions.SpacesWithinBrackets && rankSpecifier[i] > 0;
+ if (outputSpace) {
outputFormatter.Space();
}
for (int j = 0; j < rankSpecifier[i]; ++j) {
outputFormatter.PrintToken(Tokens.Comma);
}
- if (this.prettyPrintOptions.SpacesWithinBrackets) {
+ if (outputSpace) {
outputFormatter.Space();
}
outputFormatter.PrintToken(Tokens.CloseSquareBracket);
@@ -2680,14 +2681,15 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
if (arrayCreateExpression.Arguments.Count > 0) {
outputFormatter.PrintToken(Tokens.OpenSquareBracket);
- if (this.prettyPrintOptions.SpacesWithinBrackets) {
+ bool outputSpace = this.prettyPrintOptions.SpacesWithinBrackets && arrayCreateExpression.Arguments.Count > 0;
+ if (outputSpace) {
outputFormatter.Space();
}
for (int i = 0; i < arrayCreateExpression.Arguments.Count; ++i) {
if (i > 0) PrintFormattedComma();
TrackVisit(arrayCreateExpression.Arguments[i], data);
}
- if (this.prettyPrintOptions.SpacesWithinBrackets) {
+ if (outputSpace) {
outputFormatter.Space();
}
outputFormatter.PrintToken(Tokens.CloseSquareBracket);