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 about DiagnosticHandler, see doc in ‘compiler_base/error/diagnostic/diagnostic_handler.rs’.

  • TODO(zongz): Compiler-Base-Error provides ErrorRecover to recover from errors.

Modules§

components
‘components.rs’ defines all components with style DiagnosticStyle that builtin in compiler_base_error.
diagnostic_handler
This crate provides DiagnosticHandler supports 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 WriteColor using standard ANSI escape sequences.
Buffer
Write colored text to memory.
BufferWriter
Writes colored buffers to stdout or stderr.
ColorSpec
A color specification.
Diagnostic
Diagnostic is a collection of various components, and any data structure that implements Component can be a part of Diagnostic.
EmitterWriter
EmitterWriter implements trait Emitter based on termcolor1.0 for rendering diagnostic as strings and displaying them to the terminal.
StandardStream
Satisfies io::Write and WriteColor, and supports optional coloring to either of the standard output streams, stdout and stderr.
StyledBuffer
An acceptable custom XXXStyle for StyledBuffer must implement trait Clone, PartialEq, Eq and Style.
StyledString
An acceptable custom XXXStyle for StyledString must implement trait Clone, PartialEq, Eq and Style.

Enums§

ColorChoice
ColorChoice represents the color preferences of an end user.
Destination
Emit destinations provide four ways to emit.
DiagnosticStyle
‘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 Emitter for emitting diagnostic.

Functions§

emit_diagnostic_to_uncolored_text
Emit the Diagnostic with DiagnosticStyle to uncolored text strng.