mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Make macro system and PTY test leaf
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
[package]
|
||||
name = "unshell-macros"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
description = "Procedural macros for UnShell leaves"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
unshell-macros-core = { workspace = true }
|
||||
|
||||
[lints.rust]
|
||||
elided_lifetimes_in_paths = "warn"
|
||||
future_incompatible = { level = "warn", priority = -1 }
|
||||
nonstandard_style = { level = "warn", priority = -1 }
|
||||
rust_2018_idioms = { level = "warn", priority = -1 }
|
||||
rust_2021_prelude_collisions = "warn"
|
||||
semicolon_in_expressions_from_macros = "warn"
|
||||
unsafe_op_in_unsafe_fn = "warn"
|
||||
unused_import_braces = "warn"
|
||||
unused_lifetimes = "warn"
|
||||
trivial_casts = "allow"
|
||||
@@ -0,0 +1,15 @@
|
||||
//! Procedural macro shim for UnShell.
|
||||
//!
|
||||
//! The real parser and code generator live in `unshell-macros-core` so they can be
|
||||
//! tested as ordinary Rust. This crate only adapts compiler `TokenStream`s.
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
|
||||
/// Generates an `unshell_protocol::Leaf` wrapper for a user-owned state struct.
|
||||
///
|
||||
/// See `LEAF_MACRO_INTERFACE.md` for the design contract. The generated wrapper owns
|
||||
/// session stores, retry queues, filtered packet dispatch, and final-frame cleanup.
|
||||
#[proc_macro_attribute]
|
||||
pub fn unshell_leaf(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
unshell_macros_core::expand_unshell_leaf(attr.into(), item.into()).into()
|
||||
}
|
||||
Reference in New Issue
Block a user