ferroui_markup_xaml_loader/lib.rs
1//! ferroui-markup-xaml-loader
2//!
3//! The XAML language of the framework: the compiler extensions (language definition,
4//! well-known types, AST nodes, transformers) that turn a parsed XAML document into the typed
5//! AST the back ends consume. The crate builds on `xamlx` and mirrors the layout of the
6//! upstream loader project module for module:
7//!
8//! | Module | Upstream | Contents |
9//! |---|---|---|
10//! | [`compiler_extensions`] | `CompilerExtensions/` | language, well-known types, nodes, transformers |
11//! | [`parsers`] | `Markup.Xaml/Parsers` | parsers shared with the markup runtime |
12//! | [`back_end`] | (none) | what the interpreter and the emitter of Rust source share |
13//! | [`testing`] | (none) | the in-memory framework fixture for unit tests (feature `testing`) |
14//!
15//! There is no IL back end. Types that generate IL upstream carry their data and document the
16//! semantics a back end has to implement; see the table in [`compiler_extensions`].
17
18#![forbid(unsafe_code)]
19// The port keeps the upstream shapes (constructor argument lists, callback signatures).
20#![allow(clippy::type_complexity, clippy::too_many_arguments)]
21
22/// What the run-time and the build-time back end share, read from the transformed AST alone.
23pub mod back_end;
24pub mod compiler_extensions;
25/// The closed table of runtime library types, shared by the run-time and the build-time type system.
26pub mod core_table;
27pub mod parsers;
28
29/// The run-time back end: the run-time type system and the AST interpreter.
30#[cfg(feature = "runtime")]
31pub mod runtime;
32
33/// The emitter of Rust source: the build-time back end over the same transformed AST.
34#[cfg(any(feature = "compiler", all(test, feature = "runtime")))]
35pub mod rust_emitter;
36
37#[cfg(feature = "runtime")]
38mod ferro_runtime_xaml_loader;
39#[cfg(feature = "runtime")]
40mod ferro_xaml_il_runtime_compiler;
41
42#[cfg(feature = "runtime")]
43pub use ferro_runtime_xaml_loader::{DocumentGroup, FerroRuntimeXamlLoader};
44#[cfg(feature = "runtime")]
45pub use ferro_xaml_il_runtime_compiler::FerroXamlIlRuntimeCompiler;
46
47/// The in-memory framework type system used by unit tests of the compiler extensions.
48#[cfg(any(test, feature = "testing"))]
49pub mod testing;