vxml_pipeline/tables
Terminal table primitives and VXML Pipeline diagnostic tables.
The generic table renderer accepts ordinary cell rows and spanning rows.
Other functions in this module adapt pipeline steps, timings, and blame for
the package’s command-line presentation.
Types
Per-column padding applied to the right of cell content.
pub type ColumnStyle {
ColumnStyle(padding_right: Int)
}
Constructors
-
ColumnStyle(padding_right: Int)
One table cell and the one-character string used to fill unused width.
pub type TableCell {
TableCell(content: String, fill: String)
}
Constructors
-
TableCell(content: String, fill: String)
Values
pub fn four_column_table(
lines: List(
either_or.EitherOr(#(String, String, String, String), String),
),
) -> List(String)
Renders quadruples and spanning rows as a boxed four-column table.
pub fn how_many(
singular: String,
plural: String,
count: Int,
) -> String
Formats a count followed by the appropriate singular or plural noun.
pub fn name_and_param_string_lines(
desugarer: core.Desugarer,
step_no: Int,
margin: Int,
) -> List(String)
Formats a desugarer’s numbered name, parameter, and optional outside list as terminal lines.
pub fn our_blame_digest(blame: blame.Blame) -> String
Returns a compact blame description, using "--" when blame is absent.
pub fn print_lines_at_indent(
lines: List(String),
indent: Int,
) -> Nil
Prints lines with indent spaces prepended to each line.
pub fn print_pipeline(
desugarers: List(core.Desugarer),
default_name_columns: Int,
default_param_columns: Int,
default_outside_columns: Int,
) -> Nil
Prints the configured desugaring pipeline as a diagnostic table.
pub fn solid_dashes(num: Int) -> String
Repeats the box-drawing horizontal character num times.
pub fn table(
rows: List(TableRow),
columns: List(ColumnStyle),
) -> List(String)
Render a boxed table whose first row is its header.
pub fn three_column_table(
lines: List(
either_or.EitherOr(#(String, String, String), String),
),
) -> List(String)
Renders triples and spanning rows as a boxed three-column table.
pub fn two_column_maxes(
lines: List(#(String, String)),
) -> #(Int, Int)
Returns the maximum content widths of a list of two-column rows.
pub fn two_column_table(
lines: List(#(String, String)),
) -> List(String)
Renders pairs as a boxed two-column table.