From 5c3be8f4ccbf2f88000a0d317a1b8de31842244d Mon Sep 17 00:00:00 2001 From: Alex Lyman Date: Tue, 14 Jun 2011 11:25:22 -0700 Subject: [PATCH] - Modified the InitializerPeepholeTransforms' Array Initializers to do a forward scan of the block instead of just checking the next instruction. The next-instruction thing breaks down under the case where you have an array-of-arrays (int[][]) - Added to the InitializerPeepholeTransforms' Array Initializers to detect the creation of a multi-dimensional array (int[,]) - Modified the ILCode.InitArray contract to take an ArrayType instead of just the element type, and passing with the ArrayType.Dimensions set accordingly. - AstMethodBodyBuilder now used the ArrayType.Dimensions info to build a tree of ArrayInitializerExpressions from the raw, element-by-element list. - Fixed OutputVisitor not calling StartNode for EmptyExpressions Known issues: - ArrayCreateExpression outputs extra space in the array specifier when using EmptyExpressions, ala: "new int[][, ]" - The tree of ArrayInitializerExpressions outputs with blank lines before and after each block. --- ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index 8e33190067..bb1391c25d 100644 --- a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -838,6 +838,7 @@ namespace ICSharpCode.NRefactory.CSharp public object VisitEmptyExpression (EmptyExpression emptyExpression, object data) { + StartNode(emptyExpression); return EndNode (emptyExpression); } #region VisitPrimitiveExpression