mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
wip: scaffold proc crate and view macro
This commit is contained in:
parent
21f7f6b38a
commit
2c797fd41f
9 changed files with 135 additions and 5 deletions
26
proc/src/lib.rs
Normal file
26
proc/src/lib.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
extern crate proc_macro;
|
||||
use proc_macro::TokenStream;
|
||||
use proc_macro2::{TokenStream as TokenStream2};
|
||||
|
||||
mod proc_view;
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn view (meta: TokenStream, item: TokenStream) -> TokenStream {
|
||||
self::proc_view::view_impl(meta.into(), item.into()).into()
|
||||
//for attr in syn::parse_macro_input!(meta as syn::MetaList).iter() {
|
||||
//}
|
||||
//let item = syn::parse_macro_input!(item as syn::ItemImpl);
|
||||
//let output = "TuiOut";
|
||||
//let target = "Tek";
|
||||
//let define = "self.config.view";
|
||||
//let expose = vec![];
|
||||
//let output = format!(
|
||||
//"::tengri_dsl::view!({}:|self:{}|self.size.of(::tengri_dsl::View(self,{}));{{{}}});",
|
||||
//output,
|
||||
//target,
|
||||
//define,
|
||||
//expose.iter().fold(String::new(), |acc, (key, value)|format!("{acc},{key}=>{value}")),
|
||||
//);
|
||||
//let output = "";
|
||||
//output.parse().unwrap()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue