Skip to main content

Crate formally_support

Crate formally_support 

Source
Expand description

Support utilities common to all formally submodules.

WARNING: This crate is not supposed to be used directly.

Use instead the formally::support module of the main formally crate.

The support crate includes several components used throughout all the formally modules and frequently used by any client code.

These include: 2. The diagnostics system, including the error macro, the Emitter trait and different types of emitters. 3. The Scope type to help implementing statically scoped languages. 4. Utilities to represent and keep track of source locations, including the Location and the Span types. 5. Procedural macros to derive the Located and Locatable traits. 6. The Nominal smart pointer. 7. The Stack trait and the Stacked utility type to help implementing it. 8. The SArc wrapper over either an Arc or a static reference to an object.

Macros§

debug
Emits a diagnostic of level Level::Debug with a formatted message.
diagnose
Generic and more flexible version of the error!, warning!, etc. macros.
error
Emit a diagnostic of level Level::Error with a formatted message.
internal
Emit a diagnostic of level Level::Internal with a formatted message.
note
Emit a note of kind NoteKind::Note with a formatted message.
trace
Emit a note of kind NoteKind::Trace with a formatted message.
warning
Emits a diagnostic of level Level::Warning with a formatted message.

Structs§

BatchEmitter
Emitter that delays the emission of diagnostics until an explicit commit.
Diagnostic
Information attached to a diagnostic.
DiagnosticEmitted
Tag error type to signal that a diagnostic has been emitted
Identifier
A string associated with its source span.
Loc
Wrap any type with location information.
Location
Represent a position in a source file.
LookupSet
Result of a lookup by name in a Scope.
Nominal
Smart pointer wrapper for identity-based equality comparisons and hashing
NullEmitter
Emitter that throws away any diagnostic.
Scope
Utility to implement lookup scopes.
Stacked
A helper type to implement the Stack trait
StdErrEmitter
An Emitter rendering diagnositcs on the standard error stream.

Enums§

Level
Severity level of a diagnostic.
NoteKind
Kind of note to emit in Emitter::note
Origin
Tracks the origin of a set of source locations
SArc
Either a static reference or an Arc.
Span
Track an interval between two locations in a source file.

Traits§

Diagnosable
Trait for types that contain all the necessary information to implement the Emit trait.
Emit
Trait for types that can emit themselves as diagnostics.
Emitter
Trait for objects capable of emitting (or routing) diagnostics.
Locatable
Add or set a Span to a type.
Located
Types that track a Span.
Stack
Trait to model entities that can push and pop their state on a stack structure.

Type Aliases§

Result
Error type for usage in formally.

Derive Macros§

Locatable
Procedural macro to derive the Locatable trait.
Located
Procedural macro to derive the Located trait.