#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct CompiledSelector {
pub(super) compounds: Vec<Compound>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct Compound {
pub(super) subject: Simple,
pub(super) prefix: Vec<(Combinator, Simple)>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(super) enum Combinator {
Descendant,
Child,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) struct Simple {
pub(super) tag: Option<String>,
pub(super) predicates: Vec<Predicate>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(super) enum Predicate {
HasAttr(String),
AttrEquals(String, String),
AttrStartsWith(String, String),
AttrEndsWith(String, String),
AttrContains(String, String),
FirstChild,
NthChild(u32),
Not(Box<Simple>),
}