Skip to main content

Crate microcad_lang_base

Crate microcad_lang_base 

Source
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::print is printing.
CodeFormatContext
Default code format context
CodeList
For inline items separated by commas (like function arguments)
CodeStack
For statements or items that should be on their own indented lines
CompactString
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
DiagHandler
Handler for diagnostics.
DiagRenderOptions
Options that control the rendering of diagnostics
Diagnostics
µcad source diagnostics.
FormatTree
print syntax via std::fmt::Display
Hashed
Generic wrapper that contains the hashed value.
Identifier
µcad identifier
LineCol
Line and column within a source code file
LineIndex
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
An unparsed source code with a location
SourceLocInfo
A compatibility layer for using SourceFile with miette
SrcRef
Reference into a source file.
Stdout
Output what __builtin::print is printing to stdout.
TreeState
Indention depth counter
Url
URL to locate sources. A parsed URL record.

Enums§

DiagError
Diagnostic error.
Diagnostic
Diagnostic message with source code reference attached.
Level
The level of the diagnostic.

Constants§

MICROCAD_EXTENSIONS
List of valid µcad extensions.

Traits§

CodeDisplay
Trait to display valid µcad source code.
ComputedHash
Trait to implement for typed that contain a pre-computed hash value.
Diag
Diagnosis trait gives access about collected errors.
GetSourceLocInfoByHash
Trait that can fetch for a file by it’s hash value.
OrdMapValue
Trait a value in an OrdMap must implement.
Output
Trait which Context is using to access or redirect the µcad code’s console output.
PushDiag
A trait to add diagnostics with different levels conveniently.
ResourceLocation
SrcReferrer
Elements holding a source code reference shall implement this trait
ToCompactString
A trait for converting a value to a CompactString.
TreeDisplay
Trait for displaying a tree
WriteToFile
Trait to write something with Display trait into a file.

Functions§

shorten
Shortens given string to it’s first line and to max_chars characters.
virtual_url

Type Aliases§

DiagResult
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