diag_print.l0

diag_print.l0

Module: diag_print

Source: compiler/stage2_l0/src/diag_print.l0 Language: Dea/L0

Imports / Includes

  • std.vector
  • util.diag
  • std.text
  • std.string
  • std.io
  • std.fs
  • std.integer
  • sys.rt

Symbols

Function dp_severity_name

1
func dp_severity_name(sev: DiagnosticSeverity) -> string

Return the lowercase display name for a diagnostic severity.

Parameters:

  • sev: Severity to format.

Returns: Lowercase severity name.

Function dp_format_header

1
func dp_format_header(diag: Diagnostic*) -> string

Format the first line of a diagnostic message.

Parameters:

Returns: Header string containing location, severity, code, and message.

Function dp_print_header

1
func dp_print_header(diag: Diagnostic*)

Prints the dp print header.

Parameters:

  • diag: The diag.

Function dp_render_snippet

1
func dp_render_snippet(diag: Diagnostic*, src: string)

Render a source snippet for a diagnostic.

Parameters:

  • diag: Diagnostic to render.
  • src: Source text corresponding to diag.filename.

Function dp_print_snippet

1
func dp_print_snippet(diag: Diagnostic*)

Prints the dp print snippet.

Parameters:

  • diag: The diag.

Function dp_source_cached

1
func dp_source_cached(cache_names: StringVector*, cache_texts: StringVector*, filename: string) -> string

Return cached source text for a filename, loading and caching it on demand.

Parameters:

  • cache_names: Cached filenames.
  • cache_texts: Cached source texts aligned with cache_names.
  • filename: Filename to load.

Returns: Cached or newly loaded source text, or an empty string on read failure.

Function dp_print_diag

1
func dp_print_diag(diag: Diagnostic*)

Prints the dp print diag.

Parameters:

  • diag: The diag.

Function dp_print_collector_with_sources

1
func dp_print_collector_with_sources(dc: DiagCollector*, source_names: StringVector*, source_texts: StringVector*)

Print all diagnostics using caller-provided source-text caches.

Parameters:

  • dc: Diagnostic collector to print.
  • source_names: Cached filenames aligned with source_texts.
  • source_texts: Cached source texts aligned with source_names.

Function dp_print_collector

1
func dp_print_collector(dc: DiagCollector*)

Prints the dp print collector.

Parameters:

  • dc: The dc.