Skip to content

Commit e6c6346

Browse files
committed
Completely remove GenerateUnformatted() method.
1 parent b47ecd5 commit e6c6346

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

src/Generator/Utils/BlockGenerator.cs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -183,55 +183,6 @@ public virtual string Generate()
183183
return builder.ToString();
184184
}
185185

186-
public StringBuilder GenerateUnformatted()
187-
{
188-
if (CheckGenerate != null && !CheckGenerate())
189-
return new StringBuilder(0);
190-
191-
if (Blocks.Count == 0)
192-
return Text.StringBuilder;
193-
194-
var builder = new StringBuilder();
195-
Block previousBlock = null;
196-
197-
var blockIndex = 0;
198-
foreach (var childBlock in Blocks)
199-
{
200-
var childText = childBlock.GenerateUnformatted();
201-
202-
var nextBlock = (++blockIndex < Blocks.Count)
203-
? Blocks[blockIndex]
204-
: null;
205-
206-
if (nextBlock != null)
207-
{
208-
var nextText = nextBlock.GenerateUnformatted();
209-
if (nextText.Length == 0 &&
210-
childBlock.NewLineKind == NewLineKind.IfNotEmpty)
211-
continue;
212-
}
213-
214-
if (childText.Length == 0)
215-
continue;
216-
217-
if (previousBlock != null &&
218-
previousBlock.NewLineKind == NewLineKind.BeforeNextBlock)
219-
builder.AppendLine();
220-
221-
builder.Append(childText);
222-
223-
if (childBlock.NewLineKind == NewLineKind.Always)
224-
builder.AppendLine();
225-
226-
previousBlock = childBlock;
227-
}
228-
229-
if (Text.StringBuilder.Length != 0)
230-
builder.Append(Text.StringBuilder);
231-
232-
return builder;
233-
}
234-
235186
public bool IsEmpty
236187
{
237188
get
@@ -323,11 +274,6 @@ public virtual string Generate()
323274
return RootBlock.Generate();
324275
}
325276

326-
public string GenerateUnformatted()
327-
{
328-
return RootBlock.GenerateUnformatted().ToString();
329-
}
330-
331277
#region Block helpers
332278

333279
public void AddBlock(Block block)

0 commit comments

Comments
 (0)