omp-tui-macros 0.1.0

Procedural dom! markup macro for building omp-tui component trees
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 45.28 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 265.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • can1357

omp-tui-macros

omp-tui-macros provides the dom! procedural macro used by omp-tui. It parses markup with a single root element and lowers elements, attributes, expressions, string children, and child-level for, if, and match control flow into omp_tui component-builder calls.

Structure

The crate is implemented in src/lib.rs. Its token parser builds a small internal tree of elements, attributes, children, and control-flow branches. Validation handles expression syntax, matching tags, data records owned by components, and editor child constraints. The lowering layer maps known tags and properties to omp_tui::components and omp_tui::Prop, emits specialized records such as table rows and tree nodes, and uses CustomElement or custom properties for names outside those built-in mappings.

Philosophy

Keep the markup declarative while producing ordinary component construction code at compile time. Reject malformed or context-invalid markup with errors at the relevant token span, preserve embedded Rust expressions and control flow, and keep component-specific rules in the macro so callers receive diagnostics before runtime.