/// <summary> /// Formats a block into an indented string representation. /// </summary> /// <param name="block">The block to format.</param> /// <returns>The indented string.</returns> public static string Format(IBlock <TInstruction> block) { var formatter = new BlockFormatter <TInstruction>(DefaultIndentationString); var walker = new BlockWalker <TInstruction>(formatter); walker.Walk(block); return(formatter.GetOutput()); }
/// <inheritdoc /> public override string ToString() => BlockFormatter <TInstruction> .Format(this);