Skip to main content

debug_codegen/
debug_codegen.rs

1fn main() {
2    let src = r#"---
3use fncc_runtime::*;
4---
5
6<Stack direction="vertical" gap="12">
7    <Text size="xl">Olá mundo</Text>
8    <Text>Este é o fncc 🦊</Text>
9    <Button onclick="handle_click">Clique aqui</Button>
10</Stack>"#;
11
12    match fncc_core::parser::parse(src) {
13        Ok(doc) => {
14            println!("=== AST ===");
15            println!("{:#?}", doc);
16            println!("\n=== GENERATED ===");
17            println!("{}", fncc_core::codegen::generate(&doc));
18        }
19        Err(e) => println!("ERROR: {e}"),
20    }
21}