2019-10-06 23:28:39 +02:00
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
mod tokenizer;
|
|
|
|
mod parser;
|
|
|
|
pub use parser::Parser;
|
|
|
|
|
2019-10-07 00:12:31 +02:00
|
|
|
pub type Props = Vec<(String, String)>;
|
|
|
|
|
2019-10-06 23:28:39 +02:00
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
pub struct Object {
|
|
|
|
pub name: String,
|
2019-10-07 00:12:31 +02:00
|
|
|
pub content: HashMap<String, (Props, String)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Object {
|
|
|
|
pub fn get(&self, key: &'_ str) -> Option<&str> {
|
|
|
|
self.content.get(key)
|
|
|
|
.map(|(props, value)| value.as_ref())
|
|
|
|
}
|
2019-10-06 23:28:39 +02:00
|
|
|
}
|