vxml_pipeline/tracking
Serializes, selects, and displays VXML for pipeline tracking monitors.
Tracking first serializes VXML into SLine values so selectors can retain
tree structure and blame while marking lines for display. A LineSelector
selects individual lines; a Selector can inspect and transform the whole
serialized list, allowing selection to expand to ancestors or neighboring
lines. Rendering functions then produce either tables or verbatim VXML.
Types
Selects one serialized VXML line.
pub type LineSelector =
fn(SLine) -> SelectionStatus
One structural line in VXML serialized for selection and tracking.
VSLinerepresents the tag line of a V-node.ASLinerepresents one attribute line of a V-node.TSLinerepresents the<>opening line of a T-node.LSLinerepresents one content line of a T-node.
Every variant retains indentation, blame, serialized content, and selection status. V- and attribute lines additionally retain their parsed fields.
pub type SLine {
VSLine(
blame: blame.Blame,
indent: Int,
content: String,
selected: SelectionStatus,
tag: String,
)
ASLine(
blame: blame.Blame,
indent: Int,
content: String,
selected: SelectionStatus,
key: String,
val: String,
)
TSLine(
blame: blame.Blame,
indent: Int,
content: String,
selected: SelectionStatus,
)
LSLine(
blame: blame.Blame,
indent: Int,
content: String,
selected: SelectionStatus,
)
}
Constructors
-
VSLine( blame: blame.Blame, indent: Int, content: String, selected: SelectionStatus, tag: String, ) -
ASLine( blame: blame.Blame, indent: Int, content: String, selected: SelectionStatus, key: String, val: String, ) -
TSLine( blame: blame.Blame, indent: Int, content: String, selected: SelectionStatus, ) -
LSLine( blame: blame.Blame, indent: Int, content: String, selected: SelectionStatus, )
Whether and why a serialized VXML line is included in tracked output.
OG marks a direct selector match. Bystander marks structural or nearby
context added around a match.
pub type SelectionStatus {
NotSelected
OG
Bystander
}
Constructors
-
NotSelected -
OG -
Bystander
Values
pub fn apply_line_selector_to_line(
line: SLine,
line_selector: fn(SLine) -> SelectionStatus,
) -> SLine
Replaces one line’s selection status with the result of line_selector.
pub fn extend_selection_down(
lines: List(SLine),
amt: Int,
) -> List(SLine)
Adds up to amt following lines as bystander context around every direct
match.
pub fn extend_selection_to_ancestors(
lines: List(SLine),
with_elder_siblings w1: Bool,
with_ancestor_attrs w2: Bool,
with_elder_sibling_attrs w3: Bool,
) -> List(SLine)
Adds structural ancestor context around selected lines.
The boolean arguments additionally include elder sibling tags, ancestor attributes, and elder-sibling attributes respectively.
pub fn extend_selection_up(
lines: List(SLine),
amt: Int,
) -> List(SLine)
Adds up to amt preceding lines as bystander context around every direct
match.
pub fn extend_selector_down(
f: fn(List(SLine)) -> List(SLine),
amt: Int,
) -> fn(List(SLine)) -> List(SLine)
Composes a selector with downward bystander expansion.
pub fn extend_selector_to_ancestors(
f: fn(List(SLine)) -> List(SLine),
with_elder_siblings w1: Bool,
with_ancestor_attrs w2: Bool,
with_elder_sibling_attrs w3: Bool,
) -> fn(List(SLine)) -> List(SLine)
Composes a selector with structural ancestor expansion.
pub fn extend_selector_up(
f: fn(List(SLine)) -> List(SLine),
amt: Int,
) -> fn(List(SLine)) -> List(SLine)
Composes a selector with upward bystander expansion.
pub fn line_selector_to_selector(
line_selector: fn(SLine) -> SelectionStatus,
) -> fn(List(SLine)) -> List(SLine)
Lifts a line-level selector into a whole-tree selector.
pub fn or_selectors(
s1: fn(List(SLine)) -> List(SLine),
s2: fn(List(SLine)) -> List(SLine),
) -> fn(List(SLine)) -> List(SLine)
Combines two selectors, preserving the strongest selection status assigned to each line.
pub fn select_relative_window(
selector: fn(List(SLine)) -> List(SLine),
first_offset: Int,
last_offset: Int,
) -> fn(List(SLine)) -> List(SLine)
Restricts a selector to the inclusive line-offset interval around each direct match. Offsets may lie wholly before or wholly after a match.