Add XML Parsing

This commit is contained in:
Michael Mikovsky
2025-10-30 14:44:41 -06:00
parent 2cbf0fcab2
commit 48067c3eef
13 changed files with 274 additions and 46 deletions
+20
View File
@@ -0,0 +1,20 @@
use std::collections::HashMap;
use crate::views::View;
mod interpreter;
mod parser;
pub const TEST_XML: &'static str = include_str!("../../pages/main.xml");
#[derive(Debug)]
struct Tag {
name: String,
children: Vec<Tag>,
attributes: HashMap<String, String>,
}
pub fn parse(xml: &str) -> Box<dyn View> {
let tag = parser::parse_xml(xml);
interpreter::interpret_tag(tag)
}