fixup! inline fixup
This commit is contained in:
parent
641e904074
commit
b78b2866a8
1 changed files with 2 additions and 12 deletions
|
@ -398,7 +398,7 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
|
||||||
*d == delim || matches!((d, delim), (Delim::Span(..), Delim::Span(..)))
|
*d == delim || matches!((d, delim), (Delim::Span(..), Delim::Span(..)))
|
||||||
})
|
})
|
||||||
.and_then(|o| {
|
.and_then(|o| {
|
||||||
if !dir.can_close() {
|
if matches!(dir, Dir::Open) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let (d, e) = self.openers[o];
|
let (d, e) = self.openers[o];
|
||||||
|
@ -473,7 +473,7 @@ impl<I: Iterator<Item = char> + Clone> Parser<I> {
|
||||||
event_closer
|
event_closer
|
||||||
})
|
})
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
if !dir.can_open() {
|
if matches!(dir, Dir::Close) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
self.openers.push((delim, self.events.len()));
|
self.openers.push((delim, self.events.len()));
|
||||||
|
@ -584,16 +584,6 @@ enum Dir {
|
||||||
Both,
|
Both,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dir {
|
|
||||||
fn can_open(self) -> bool {
|
|
||||||
matches!(self, Dir::Open | Dir::Both)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn can_close(self) -> bool {
|
|
||||||
matches!(self, Dir::Close | Dir::Both)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Delim {
|
impl Delim {
|
||||||
fn from_token(kind: lex::Kind) -> Option<(Self, Dir)> {
|
fn from_token(kind: lex::Kind) -> Option<(Self, Dir)> {
|
||||||
use Delim::*;
|
use Delim::*;
|
||||||
|
|
Loading…
Reference in a new issue