mirror of
https://github.com/Astatin3/IntroToWebAuthoring.git
synced 2026-06-09 00:28:00 -06:00
21 lines
396 B
Rust
21 lines
396 B
Rust
|
|
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)
|
||
|
|
}
|