|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Fluent builder used to enrich a just-created diagnostic. More...
#include <ah-diagnostics.H>
Public Member Functions | |
| Diagnostic_Builder (Diagnostic_Engine &engine, const size_t index) noexcept | |
Constructs a builder bound to engine[index]. | |
| Diagnostic_Builder & | code (const std::string &value) |
| Sets the stable diagnostic code. | |
| Diagnostic_Builder & | primary (const Source_Span &span, const std::string &msg="") |
| Adds a primary label. | |
| Diagnostic_Builder & | secondary (const Source_Span &span, const std::string &msg) |
| Adds a secondary label. | |
| Diagnostic_Builder & | note (const std::string &msg) |
| Appends a note line. | |
| Diagnostic_Builder & | help (const std::string &msg) |
| Appends a help line. | |
| size_t | emit () const noexcept |
| Finalizes the builder and returns the diagnostic index. | |
Private Member Functions | |
| Diagnostic & | diag () |
Private Attributes | |
| Diagnostic_Engine * | engine = nullptr |
| size_t | diag_index = 0 |
Fluent builder used to enrich a just-created diagnostic.
Definition at line 104 of file ah-diagnostics.H.
|
inlinenoexcept |
Constructs a builder bound to engine[index].
Definition at line 113 of file ah-diagnostics.H.
|
inline |
Sets the stable diagnostic code.
Definition at line 373 of file ah-diagnostics.H.
References Aleph::Diagnostic::code, diag(), and value.
Referenced by Aleph::compiler_emit_module_name_resolution_diagnostic(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Line_Frontend::emit_error(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), main(), Aleph::Interpreter_Runtime::runtime_error(), TEST(), TEST(), TEST(), and TEST().
|
inlineprivate |
Definition at line 365 of file ah-diagnostics.H.
References ah_runtime_error_unless, diag_index, Aleph::Diagnostic_Engine::diags, and engine.
Referenced by code(), help(), note(), primary(), and secondary().
|
inlinenoexcept |
Finalizes the builder and returns the diagnostic index.
Definition at line 139 of file ah-diagnostics.H.
References diag_index.
Referenced by Aleph::compiler_emit_module_name_resolution_diagnostic(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Line_Frontend::emit_error(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), main(), Aleph::Interpreter_Runtime::runtime_error(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Appends a help line.
Definition at line 401 of file ah-diagnostics.H.
References Aleph::DynArray< T >::append(), diag(), and Aleph::Diagnostic::help.
Referenced by Aleph::compiler_emit_module_name_resolution_diagnostic(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), main(), Aleph::Interpreter_Runtime::runtime_error(), TEST(), and TEST().
|
inline |
Appends a note line.
Definition at line 394 of file ah-diagnostics.H.
References Aleph::DynArray< T >::append(), diag(), and Aleph::Diagnostic::notes.
Referenced by Aleph::compiler_emit_module_name_resolution_diagnostic(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), main(), Aleph::Interpreter_Runtime::runtime_error(), TEST(), and TEST().
|
inline |
Adds a primary label.
| span | Span to highlight. |
| msg | Optional label-specific message shown near the underline. |
Definition at line 380 of file ah-diagnostics.H.
References diag(), Aleph::Diagnostic::labels, and Aleph::Primary.
|
inline |
Adds a secondary label.
Definition at line 387 of file ah-diagnostics.H.
References diag(), Aleph::Diagnostic::labels, and Aleph::Secondary.
Referenced by TEST().
|
private |
Definition at line 107 of file ah-diagnostics.H.
|
private |
Definition at line 106 of file ah-diagnostics.H.
Referenced by diag().