block.rs 668 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. use std::collections::VecDeque;
  2. use dioxus_rsx::{BodyNode, CallBody};
  3. const LINE_WIDTH: usize = 80;
  4. pub struct Printer {
  5. buf: String,
  6. // queue: Vec<Item>,
  7. }
  8. pub enum Break {
  9. // Space flexes to line if need be
  10. Space,
  11. // Line always forces a new line
  12. // Comments are an example of this
  13. Line,
  14. }
  15. // enum Item {
  16. // BreakBegin,
  17. // BreakEnd,
  18. // Text(Cow<'static, str>),
  19. // }
  20. impl Printer {
  21. fn doit(&mut self, body: CallBody) {
  22. for node in body.roots {}
  23. }
  24. fn node(&mut self, node: BodyNode) {}
  25. }
  26. #[test]
  27. fn it_works() {
  28. let src = r#"div {}"#;
  29. let contents: CallBody = syn::parse_str(src).unwrap();
  30. }