Expand description
Compiler-Base-Error
The idea with Compiler-Base-Error is to make a reusable library,
by separating out error thorwing and diagnostic diaplaying or other error handling procedures.
-
Compiler-Base-Error provides
DiagnosticHandlerto diaplay diagnostic. For more information aboutDiagnosticHandler, see doc in ‘compiler_base/error/diagnostic/diagnostic_handler.rs’. -
TODO(zongz): Compiler-Base-Error provides
ErrorRecoverto recover from errors.
Modules§
- components
- ‘components.rs’ defines all components with style
DiagnosticStylethat builtin in compiler_base_error. - diagnostic_
handler - This crate provides
DiagnosticHandlersupports diagnostic messages to terminal stderr. - errors
- This crate provides all error types used in compiler-base-error.
- unit_
type - This file provides some of the self-encapsulated types used in handling error messages.
Structs§
- Ansi
- Satisfies
WriteColorusing standard ANSI escape sequences. - Buffer
- Write colored text to memory.
- Buffer
Writer - Writes colored buffers to stdout or stderr.
- Color
Spec - A color specification.
- Diagnostic
Diagnosticis a collection of various components, and any data structure that implementsComponentcan be a part ofDiagnostic.- Emitter
Writer EmitterWriterimplements traitEmitterbased ontermcolor1.0for rendering diagnostic as strings and displaying them to the terminal.- Standard
Stream - Satisfies
io::WriteandWriteColor, and supports optional coloring to either of the standard output streams, stdout and stderr. - Styled
Buffer - An acceptable custom
XXXStyleforStyledBuffermust implement traitClone,PartialEq,EqandStyle. - Styled
String - An acceptable custom
XXXStyleforStyledStringmust implement traitClone,PartialEq,EqandStyle.
Enums§
- Color
Choice - ColorChoice represents the color preferences of an end user.
- Destination
- Emit destinations provide four ways to emit.
- Diagnostic
Style - ‘DiagnosticStyle’ defines all the styles that needed when displaying diagnostic message.
Traits§
- Component
- ‘Component’ specifies the method
format()that all diagnostic components should implement. - Emitter
- trait
Emitterfor emitting diagnostic.
Functions§
- emit_
diagnostic_ to_ uncolored_ text - Emit the
DiagnosticwithDiagnosticStyleto uncolored text strng.