chore: initial draft of proc macros

This commit is contained in:
2026-07-08 17:30:52 -04:00
parent 8e43ff75a5
commit c637ad2d76
8 changed files with 71 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
[package]
name = "python-utils-macros-impl"
version = "0.1.0"
edition = "2024"
[dependencies]
proc-macro2 = "1.0.106"
quote = "1.0.46"
syn = "2.0.118"

View File

@@ -0,0 +1,17 @@
use proc_macro2::TokenStream;
use quote::quote;
use syn::{DeriveInput, parse_macro_input};
pub fn py_from_str(input: TokenStream) -> TokenStream {
let derive_input: DeriveInput = parse_macro_input!(input);
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
let expanded = quote! {
impl #impl_generics MyTrait for #name #ty_generics #where_clause {
// ...
}
};
expanded
}