Expand description
µcad language base components for error handling etc.
Macros§
- code_
display - Code display macro for a DSL.
- mark
- Create a marker string which is colored with ANSI.
Structs§
- Capture
- Output buffer to catch what
__builtin::printis printing. - Code
Format Context - Default code format context
- Code
List - For inline items separated by commas (like function arguments)
- Code
Stack - For statements or items that should be on their own indented lines
- Compact
String - A
CompactStringis a compact string type that can be used almost anywhere aStringorstrcan be used. - Diag
Handler - Handler for diagnostics.
- Diag
Render Options - Options that control the rendering of diagnostics
- Diagnostics
- µcad source diagnostics.
- Format
Tree - print syntax via std::fmt::Display
- Hashed
- Generic wrapper that contains the hashed value.
- Hasher
- A speedy hash algorithm for use within rustc. The hashmap in liballoc by default uses SipHash which isn’t quite as speedy as we want. In the compiler we’re not really worried about DOS attempts, so we use a fast non-cryptographic hash.
- Identifier
- µcad identifier
- LineCol
- Line and column within a source code file
- Line
Index - An index to retrieve the offsets in a line in O(log(n)).
- OrdMap
- Map whose values can be accessed via index in original insert order.
- Rc
- A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
- RcMut
- Just a short cut definition
- Refer
- Packs any value together with a source reference
- Source
- Unparsed source code with a location.
- Source
LocInfo - A compatibility layer for using SourceFile with miette
- Spanned
- Something that has a span attached.
- SrcRef
- Reference into a source file.
- Stdout
- Output what
__builtin::printis printing to stdout. - Tree
State - Indention depth counter
- Url
- URL to locate sources. A parsed URL record.
Enums§
- Diag
Error - Diagnostic error.
- Diag
Level - The level of the diagnostic.
- Diagnostic
- Diagnostic message with source code reference attached.
- Level
- The level of the diagnostic.
- Workbench
Kind - The possible type of workbenches
Constants§
- MICROCAD_
EXTENSION - Default extension for µcad files.
- MICROCAD_
EXTENSIONS - List of valid µcad extensions.
Traits§
- Code
Display - Trait to display valid µcad source code.
- Computed
Hash - Trait to implement for typed that contain a pre-computed hash value.
- Diag
- Diagnosis trait gives access about collected errors.
- GetSource
LocInfo ByHash - Trait that can fetch for a file by it’s hash value.
- OrdMap
Value - Trait a value in an
OrdMapmust implement. - Output
- Trait which Context is using to access or redirect the µcad code’s console output.
- Push
Diag - A trait to add diagnostics with different levels conveniently.
- Resource
Location - SrcReferrer
- Elements holding a source code reference shall implement this trait
- ToCompact
String - A trait for converting a value to a
CompactString. - Tree
Display - Trait for displaying a tree
- Write
ToFile - Trait to write something with Display trait into a file.
Functions§
- shorten
- Shortens given string to it’s first line and to
max_charscharacters. - virtual_
url
Type Aliases§
- Diag
Result - Result type of any resolve.
- HashId
- Render hash type.
- HashMap
- Type alias for a hash map that uses the Fx hashing algorithm.
- HashSet
- Type alias for a hash set that uses the Fx hashing algorithm.
- Id
- Id type (base of all identifiers)
- Span
- Span for tokens or AST nodes, a range of byte offsets from the start of the source