diag_print.l0
Module: diag_print
Source: compiler/stage2_l0/src/diag_print.l0 Language: Dea/L0
Imports / Includes
std.vectorutil.diagstd.textstd.stringstd.iostd.fsstd.integersys.rt
Symbols
- dp_severity_name
- dp_format_header
- dp_print_header
- dp_render_snippet
- dp_print_snippet
- dp_source_cached
- dp_print_diag
- dp_print_collector_with_sources
- dp_print_collector
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:
diag: Diagnostic to format.
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 todiag.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 withcache_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 withsource_texts.source_texts: Cached source texts aligned withsource_names.
Function dp_print_collector
1
func dp_print_collector(dc: DiagCollector*)
Prints the dp print collector.
Parameters:
dc: The dc.