wip: wire up bodynodes in more places

This commit is contained in:
Jonathan Kelley 2022-10-05 01:13:14 -07:00
parent 928b5358b2
commit 03bc63dacc
2 changed files with 21 additions and 0 deletions

View file

@ -69,6 +69,8 @@ impl Buffer {
BodyNode::Component(component) => self.write_component(component),
BodyNode::Text(text) => self.write_text(text),
BodyNode::RawExpr(exp) => self.write_raw_expr(exp),
BodyNode::ForLoop(exp) => self.write_for_loop(exp),
BodyNode::IfChain(exp) => self.write_if_chain(exp),
}
}

View file

@ -1,6 +1,8 @@
//! pretty printer for rsx!
use std::fmt::{Result, Write};
use dioxus_rsx::ForLoop;
use crate::Buffer;
impl Buffer {
@ -41,6 +43,23 @@ impl Buffer {
Ok(())
}
pub fn write_if_chain(&mut self, exp: &syn::ExprIf) -> Result {
todo!()
}
pub fn write_for_loop(&mut self, for_loop: &ForLoop) -> Result {
let ForLoop {
for_token,
pat,
in_token,
expr,
body,
} = for_loop;
todo!()
// self.write_raw_expr(&for_loop.expr)?;
// Ok(())
}
}
// :(