rbx_rsml/parser/
tree_node.rs

1use std::collections::{HashMap, HashSet};
2use rbx_types::{Attributes, Variant};
3
4#[derive(Debug)]
5pub struct TreeNode {
6    pub selector: Option<String>,
7    pub name: Option<String>,
8    pub derives: HashSet<String>,
9    pub priority: Option<i32>,
10    pub attributes: Attributes,
11    pub properties: HashMap<String, Variant>,
12    pub rules: Vec<usize>,
13    pub parent: usize
14}
15
16impl TreeNode {
17    pub fn new(parent: usize, selector: Option<String>) -> Self {
18        Self {
19            attributes: Attributes::new(),
20            properties: HashMap::new(),
21            derives: HashSet::new(),
22            rules: vec![],
23            priority: None,
24            name: None,
25            selector,
26            parent
27        }
28    }
29}