Obtain Xmeta `(...)` content as tokens, ie not insisting on a string literal
I'd like to be able to clone the #[builder(derive(..))]
feature, but it doesn't seem to be possible to treat everything under a $tmeta
as something to extract.
Here's a thing that doesn't work:
define_derive_deftly! {
pub Builder =
#[derive( ${tmeta(builder(derive))} )]
pub struct $<$tname Builder> {
}
}
#[derive(Deftly)]
#[derive_deftly(Builder)]
#[deftly(builder(derive(Clone,Debug)))]
pub struct MyStruct {
}
Instead, I've had to say:
define_derive_deftly! {
pub Builder =
#[derive( ${tmeta(builder(derive)) as tokens} )]
pub struct $<$tname Builder> {
}
}
#[derive(Deftly)]
#[derive_deftly(Builder)]
#[deftly(builder(derive = "Clone, Debug"))]
pub struct MyStruct {
}
Maybe we could have a new $Xmeta_content
that expands to everything inside of the metadata node. (That is, for #[deftly(builder(derive(Clone,Debug)))]
, ${Xmeta_content(builder_derive)}
would expand to Clone, Debug
.