output: more big refactors

This commit is contained in:
🪞👃🪞 2025-09-07 12:34:30 +03:00
parent 194f2f9874
commit 5e6338fad8
68 changed files with 1604 additions and 1016 deletions

View file

@ -71,8 +71,8 @@ pub(crate) fn write_quote_to (out: &mut TokenStream2, quote: TokenStream2) {
}
#[cfg(test)] #[test] fn test_proc_view () {
let x: crate::proc_view::ViewMeta = pq! { SomeOutput };
let output: Ident = pq! { SomeOutput };
let x: crate::proc_view::ViewMeta = pq! { SomeOut };
let output: Ident = pq! { SomeOut };
assert_eq!(x.output, output);
// TODO
@ -103,10 +103,10 @@ pub(crate) fn write_quote_to (out: &mut TokenStream2, quote: TokenStream2) {
//]);
// FIXME
//let parsed: ViewDefinition = pq! {
//#[tengri_proc::view(SomeOutput)]
//#[tengri_proc::view(SomeOut)]
//impl SomeView {
//#[tengri::view(":view-1")]
//fn view_1 (&self) -> impl Render<SomeOutput> + use<'_> {
//fn view_1 (&self) -> impl Draw<SomeOut> + use<'_> {
//"view-1"
//}
//}
@ -114,19 +114,19 @@ pub(crate) fn write_quote_to (out: &mut TokenStream2, quote: TokenStream2) {
//let written = quote! { #parsed };
//assert_eq!(format!("{written}"), format!("{}", quote! {
//impl SomeView {
//fn view_1 (&self) -> impl Render<SomeOutput> + use<'_> {
//fn view_1 (&self) -> impl Draw<SomeOut> + use<'_> {
//"view-1"
//}
//}
///// Generated by [tengri_proc].
//impl ::tengri::output::Content<SomeOutput> for SomeView {
//fn content (&self) -> impl Render<SomeOutput> {
//impl ::tengri::output::Content<SomeOut> for SomeView {
//fn content (&self) -> impl Draw<SomeOut> {
//self.size.of(::tengri::output::View(self, self.config.view))
//}
//}
///// Generated by [tengri_proc].
//impl<'a> ::tengri::dsl::ViewContext<'a, SomeOutput> for SomeView {
//fn get_content_sym (&'a self, value: &Value<'a>) -> Option<RenderBox<'a, SomeOutput>> {
//impl<'a> ::tengri::dsl::ViewContext<'a, SomeOut> for SomeView {
//fn get_content_sym (&'a self, value: &Value<'a>) -> Option<DrawBox<'a, SomeOut>> {
//match value {
//::tengri::dsl::Value::Sym(":view-1") => self.view_1().boxed(),
//_ => panic!("expected Sym(content), got: {value:?}")