Пример #1
0
        /// <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());
        }
Пример #2
0
 /// <inheritdoc />
 public override string ToString() => BlockFormatter <TInstruction> .Format(this);