Skip to main content

Module render

Module render 

Source
Expand description

Rendering logic for ParseStack errors.

ConstantsΒ§

SNIPPET_SIZE πŸ”’
The maximum snippet length before showing a … indicator.

FunctionsΒ§

expected_message πŸ”’
Formats the given expected literals into a single β€œexpected” message:
line_bounds πŸ”’
Returns the start and end byte offsets of the line containing at.
snippet_at πŸ”’
Returns a preview of the input starting at from, truncated to SNIPPET_SIZE chars or the next newline.
underline πŸ”’
Returns the indentation and the underline for the span between span_start and at.
write_footer_message πŸ”’
Writes a potentially multi-line footer message for a parser layer.