-
Notifications
You must be signed in to change notification settings - Fork 0
API Host AuroraCompilationDiagnostic
Single script compilation diagnostic exposed to hosts.
Namespace: AuroraScript. Kind: class.
Back to .NET Host API Reference
AuroraCompilationDiagnostic carries one compilation problem reported by the compiler: a message and the source location it belongs to. Hosts normally reach diagnostics through AuroraCompilationException, which exposes the full list plus the first entry.
Location is the authoritative range; FileName, LineNumber, and ColumnNumber are display-friendly projections of it.
A minimal use of AuroraCompilationDiagnostic.
try
{
await engine.BuildAsync("main.as");
}
catch (AuroraCompilationException ex)
{
var diagnostic = ex.FirstDiagnostic;
Console.Error.WriteLine($"{diagnostic.FileName}:{diagnostic.LineNumber}");
}string MessageDiagnostic text describing the compilation problem.
Parameters
None.
Returns
Returns string.
Console.Error.WriteLine(diagnostic.Message);SourceSpan LocationSource range the diagnostic points at.
Parameters
None.
Returns
Returns SourceSpan.
Behavior
Location is a SourceSpan and can be SourceSpan.None when the compiler has no usable range.
var span = diagnostic.Location;
Console.Error.WriteLine($"{span.StartLine}:{span.StartColumn}");string FileNameSource file name reported for the diagnostic.
Parameters
None.
Returns
Returns string.
Console.Error.WriteLine(diagnostic.FileName);int LineNumberLine the diagnostic points at.
Parameters
None.
Returns
Returns int.
Console.Error.WriteLine(diagnostic.LineNumber);int ColumnNumberColumn the diagnostic points at.
Parameters
None.
Returns
Returns int.
Console.Error.WriteLine(diagnostic.ColumnNumber);string ToString()Formats the diagnostic as displayable text.
Parameters
None.
Returns
Returns string.
Console.Error.WriteLine(diagnostic.ToString());AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License