vxml/io_lines
Line-based input and output helpers.
InputLine and OutputLine pair indentation and text with Blame.
They provide a small bridge between files/strings and VXML parsers or
serializers.
Types
A source line with indentation and blame.
pub type InputLine {
InputLine(blame: blame.Blame, indent: Int, suffix: String)
}
Constructors
-
InputLine(blame: blame.Blame, indent: Int, suffix: String)
An output line with indentation and blame.
pub type OutputLine {
OutputLine(blame: blame.Blame, indent: Int, suffix: String)
}
Constructors
-
OutputLine(blame: blame.Blame, indent: Int, suffix: String)
Values
pub fn input_line_to_string(line: InputLine) -> String
pub fn input_lines_table(
content: List(InputLine),
banner: String,
indent: Int,
) -> String
pub fn input_lines_to_output_lines(
lines: List(InputLine),
) -> List(OutputLine)
pub fn input_lines_to_string(lines: List(InputLine)) -> String
pub fn normalize_line_endings(source: String) -> String
Normalize CRLF and CR line endings to LF.
pub fn output_line_to_string(line: OutputLine) -> String
pub fn output_lines_table(
content: List(OutputLine),
banner: String,
indent: Int,
) -> String
pub fn output_lines_table_lines(
content: List(OutputLine),
banner: String,
indent: Int,
) -> List(String)
pub fn output_lines_table_lines_with(
content: List(OutputLine),
banner: String,
indent: Int,
blame_digest_margin: blame.BlameTableMarginColumnsMinMax,
comments_margin: blame.BlameTableMarginColumnsMinMax,
) -> List(String)
pub fn output_lines_table_with(
content: List(OutputLine),
banner: String,
indent: Int,
blame_digest_margin: blame.BlameTableMarginColumnsMinMax,
comments_margin: blame.BlameTableMarginColumnsMinMax,
) -> String
pub fn output_lines_to_string(lines: List(OutputLine)) -> String
Convert output lines to a newline-separated string.
pub fn read(
path: String,
added_indentation: Int,
) -> Result(List(InputLine), simplifile.FileError)
Read a file into input lines.
pub fn string_to_input_lines(
source: String,
path: String,
added_indentation: Int,
) -> List(InputLine)
Convert a string to input lines, preserving source path and indentation.