mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
WIP
This commit is contained in:
parent
ad0a4c9181
commit
3e3809a87c
1 changed files with 1 additions and 10 deletions
|
@ -295,26 +295,17 @@ impl SelectorMatcher for Elem {
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
struct Selector {
|
struct Selector {
|
||||||
// short circuit if the selecor cannot match
|
|
||||||
never: bool,
|
|
||||||
parts: Vec<SelPart>,
|
parts: Vec<SelPart>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Selector {
|
impl Selector {
|
||||||
fn new() -> Self {
|
fn new() -> Self {
|
||||||
Self {
|
Self { parts: vec![] }
|
||||||
never: false,
|
|
||||||
parts: vec![],
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SelectorMatcher for Selector {
|
impl SelectorMatcher for Selector {
|
||||||
fn matches(&mut self, offset: usize) -> bool {
|
fn matches(&mut self, offset: usize) -> bool {
|
||||||
if self.never {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.parts.iter().all(|part| match part {
|
self.parts.iter().all(|part| match part {
|
||||||
SelPart::Wildcard => todo!(),
|
SelPart::Wildcard => todo!(),
|
||||||
SelPart::Elem(_) => todo!(),
|
SelPart::Elem(_) => todo!(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue