Structure_RegexParser5.9.0
PrettyPrinter
State used when to pretty-printing regex ASTs.
struct PrettyPrinter
Citizens in _RegexParser
Members
init(maxTopDownLevels: Int?, minBottomUpLevels: Int?
) var depth: Int
var indentWidth: Int
The number of spaces used for indentation.
var maxTopDownLevels: Int?
The maximum number number of levels, from the root of the tree, at which to perform pattern conversion.
var minBottomUpLevels: Int?
The maximum number number of levels, from the leaf nodes of the tree, at which to perform pattern conversion.
var quantificationBehavior: AST.Quantification.Kind
func finish(
) -> String func indent(
) Indents a new line, if at the start of a line, otherwise does nothing.
func output(String
) Outputs a string directly, without termination or indentation, and without updating any internal state.
func print(String
) Print out a new entry.
func printAsCanonical(AST, delimiters: Bool, terminateLine: Bool
) Outputs a regular expression abstract syntax tree in canonical form, indenting and terminating the line, and updating its internal state.
func printBlock(String, startDelimiter: String, endDelimiter: String, (inout PrettyPrinter) -> ()
) Executes
f
inside an indented block, which has a header and delimiters.func printIndented((inout PrettyPrinter) -> ()
) Executes
f
at one increased level of indentation.func printLine(() -> String?
) Prints out a new entry by invoking
f
until it returnsnil
.func terminateLine(
) Terminates a line, updating any relevant state.