Skip to main content

Module render

Module render 

Source
Expand description

Renderings of a Diagnostic.

Both renderers read the same struct. Neither is derived from the other, and in particular the machine readable form is not produced by parsing the human one. That is the whole point of P7: the data is the source of truth and the text is a view.

Functionsยง

json_string
Quotes and escapes value as a JSON string, delimiters included.
render_human
Renders a diagnostic for a person, with the offending line and an underline.
render_json
Renders a diagnostic as a single line of JSON, for tools.