-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework block handling in C# and VB formatters; fixes #67
- Loading branch information
Showing
17 changed files
with
428 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static ExpressionToString.CSharpMultilineBlockTypes; | ||
|
||
namespace ExpressionToString { | ||
//internal class CSharpBlockMetadata { | ||
// internal CSharpMultilineBlockTypes BlockType { get; private set; } = Inline; | ||
// internal string Delimiter { get; private set; } = ","; | ||
// internal static CSharpBlockMetadata CreateMetadata(CSharpMultilineBlockTypes blockType = Inline, string delimiter = ",") => new CSharpBlockMetadata { | ||
// BlockType = blockType, | ||
// Delimiter = delimiter | ||
// }; | ||
// internal void Deconstruct(out CSharpMultilineBlockTypes blockType, out string delimiter) { | ||
// blockType = BlockType; | ||
// delimiter = Delimiter; | ||
// } | ||
//} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ExpressionToString { | ||
public enum CSharpMultilineBlockTypes { | ||
Inline, | ||
Test, | ||
Block | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Linq.Expressions; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ExpressionToString.Util { | ||
public static class BlockExpressionExtensions { | ||
public static bool HasMultipleLines(this BlockExpression expr) => expr.Variables.Any() || expr.Expressions.Count > 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ExpressionToString { | ||
internal class VBBlockMetadata { | ||
internal bool IsInMutiline { get; private set; } | ||
internal bool ParentIsBlock { get; set; } | ||
internal static VBBlockMetadata CreateMetadata(bool isInMultiline, bool parentIsBlock) => new VBBlockMetadata { | ||
IsInMutiline = isInMultiline, | ||
ParentIsBlock = parentIsBlock | ||
}; | ||
} | ||
} |
Oops, something went wrong.