mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: <200 errors yay
This commit is contained in:
parent
14d619a10a
commit
694970bf0d
20 changed files with 384 additions and 305 deletions
11
crates/tek_proc/Cargo.toml
Normal file
11
crates/tek_proc/Cargo.toml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[package]
|
||||
name = "tek_proc"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "2.0", features = ["full"] }
|
||||
quote = "1.0"
|
||||
18
crates/tek_proc/src/lib.rs
Normal file
18
crates/tek_proc/src/lib.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
use proc_macro::TokenStream;
|
||||
use syn::{parse_macro_input, Attribute, Meta};
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn render (attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
println!("attr: \"{attr}\"");
|
||||
println!("item: \"{item}\"");
|
||||
let input = syn::parse_macro_input!(attr as Meta);
|
||||
panic!("attr: \"{input:?}\"");
|
||||
item
|
||||
}
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn handle (attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
println!("attr: \"{attr}\"");
|
||||
println!("item: \"{item}\"");
|
||||
item
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue