Crate microcad_lang

Crate microcad_lang 

Source
Expand description

Processing of µcad source code.

This module includes all components to parse, resolve and evaluate µcad code and diagnose errors.

  • Load and parse source files in parse and syntax
  • Resolve parsed sources in resolve
  • Evaluate resolved sources in eval
  • Diagnose any evaluation errors in diag

The grammar of µcad can be found here.

Good starting point to understand how µcad syntax works: syntax::SourceFile::load() loads a µcad source file.

Modules§

builtin
Builtin module
diag
Handling of diagnostic errors.
eval
Evaluation of parsed content.
model
Model tree module
ord_map
Ordered Map
parse
Source code parsing
parser
µcad Code Parser
rc
Short-cut definition of Rc<std::cell::RefCell<T>> and Rc<T>
render
Model methods and trait implementations for rendering.
resolve
Single symbol resolving
src_ref
Source code references.
syntax
µcad syntax elements.
tree_display
Display trait for tree like output
ty
µcad syntax elements of types
value
Evaluation entities.

Macros§

argument
Shortcut to create a argument value
create_tuple
Create a Tuple from items
create_tuple_value
Create a Value::Tuple from items
eval_todo
Like todo!() but within a evaluation context
find_rule
Find rule or use default with proper error handling.
find_rule_exact
Find rule and return definition or ParseError::NotAvailable with proper error handling.
find_rule_opt
Find rule and return optional with proper error handling.
invalid
Generate string literal INVALIDXXX with ANSI color.
invalid_no_ansi
Generate string literal <INVALID XXX>.
mark
Create a marker string which is colored with ANSI.
parameter
Shortcut to create a ParameterValue
parse
Parse a rule from given string into a syntax element.
property
Create tuple of stringified Identifier and a Value
shorten
Shortens given string to it’s first line and to maximum characters.
tuple_expression
Create TupleExpression from µcad code

Functions§

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

Type Aliases§

Id
Id type (base of all identifiers)