mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 19:08:12 +08:00
Implement abstract syntax tree parsing of XML layout
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
use crate::layout_abstract_attributes::*;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LayoutAbstractSyntaxNode {
|
||||
pub namespace: Option<String>,
|
||||
pub name: String,
|
||||
pub attributes: Vec<Attribute>,
|
||||
}
|
||||
|
||||
impl LayoutAbstractSyntaxNode {
|
||||
pub fn new(namespace: Option<String>, tag: String, attributes: &Vec<(String, String)>) -> Self {
|
||||
for attribute in attributes {
|
||||
let parsed = parse_attribute(&attribute.1[..]);
|
||||
println!("{} : {:?} -> {:?}", attribute.0, attribute.1, parsed);
|
||||
}
|
||||
|
||||
Self {
|
||||
namespace,
|
||||
name: tag,
|
||||
attributes: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user