Crate compiler_base_error
source ·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
DiagnosticHandler
to diaplay diagnostic. For more information aboutDiagnosticHandler
, see doc in ‘compiler_base/error/diagnostic/diagnostic_handler.rs’. -
TODO(zongz): Compiler-Base-Error provides
ErrorRecover
to recover from errors.
Modules§
- ‘components.rs’ defines all components with style
DiagnosticStyle
that builtin in compiler_base_error. - This crate provides
DiagnosticHandler
supports diagnostic messages to terminal stderr. - This crate provides all error types used in compiler-base-error.
- This file provides some of the self-encapsulated types used in handling error messages.
Structs§
- Satisfies
WriteColor
using standard ANSI escape sequences. - Write colored text to memory.
- Writes colored buffers to stdout or stderr.
- A color specification.
Diagnostic
is a collection of various components, and any data structure that implementsComponent
can be a part ofDiagnostic
.EmitterWriter
implements traitEmitter
based ontermcolor1.0
for rendering diagnostic as strings and displaying them to the terminal.- Satisfies
io::Write
andWriteColor
, and supports optional coloring to either of the standard output streams, stdout and stderr. - An acceptable custom
XXXStyle
forStyledBuffer
must implement traitClone
,PartialEq
,Eq
andStyle
. - An acceptable custom
XXXStyle
forStyledString
must implement traitClone
,PartialEq
,Eq
andStyle
.
Enums§
- ColorChoice represents the color preferences of an end user.
- Emit destinations provide four ways to emit.
- ‘DiagnosticStyle’ defines all the styles that needed when displaying diagnostic message.
Traits§
- ‘Component’ specifies the method
format()
that all diagnostic components should implement. - trait
Emitter
for emitting diagnostic.
Functions§
- Emit the
Diagnostic
withDiagnosticStyle
to uncolored text strng.