jit_macro/lib.rs
1#![forbid(unsafe_code)]
2#![deny(
3 missing_docs,
4 dead_code,
5 nonstandard_style,
6 unused_imports,
7 unused_mut,
8 unused_variables,
9 unused_unsafe,
10 unreachable_patterns
11)]
12
13//! Proc-macro front-end for AArch64-only `jit!` block syntax.
14//!
15//! The macro lowers assembly-like statements into structured operand calls to
16//! `jit`, including:
17//! - labels (`name:`, `1:`, `<name`, `1f`, `=>dyn_label`),
18//! - memory operands, modifiers, register lists, and system-register syntax,
19//! - alias normalization and relocation-aware label patching.
20//!
21//! The expansion stays strict: unsupported syntax or unresolved/invalid variants are
22//! surfaced as compile-time or runtime errors instead of hidden fallback behavior.
23
24use proc_macro::TokenStream;
25
26mod ast;
27mod emit;
28mod normalize;
29mod parse;
30mod rules;
31mod shape;
32
33/// JIT block emitter for AArch64.
34///
35/// Example:
36/// - `jit!(ops ; top: ; add x1, x2, #1 ; cbnz w1, <top)`
37#[proc_macro]
38pub fn jit(input: TokenStream) -> TokenStream {
39 emit::expand(input)
40}