Table of Contents

Class CompilationDiagnostics

Namespace
Pl0.Cli.Cli
Assembly
Pl0.Cli.dll

Helper methods for compiler diagnostics and CLI exit codes.

public static class CompilationDiagnostics
Inheritance
CompilationDiagnostics
Inherited Members

Fields

CompilerErrorExitCode

Exit code for compiler errors.

public const int CompilerErrorExitCode = 97

Field Value

int

ProgramIncompleteExitCode

Exit code for incomplete programs.

public const int ProgramIncompleteExitCode = 98

Field Value

int

Methods

FormatCompilerDiagnostic(CompilerDiagnostic, bool)

Formats a compiler diagnostic for CLI output.

public static string FormatCompilerDiagnostic(CompilerDiagnostic diagnostic, bool longMessages)

Parameters

diagnostic CompilerDiagnostic

The diagnostic to format.

longMessages bool

Whether to include full message text.

Returns

string

The formatted diagnostic string.

SelectExitCode(IReadOnlyList<CompilerDiagnostic>)

Selects the exit code for a set of diagnostics.

public static int SelectExitCode(IReadOnlyList<CompilerDiagnostic> diagnostics)

Parameters

diagnostics IReadOnlyList<CompilerDiagnostic>

Compiler diagnostics.

Returns

int

The exit code.