expand inner or
pattern
This commit is contained in:
parent
3a8b0144c8
commit
90abfe9ce2
7 changed files with 88 additions and 1 deletions
|
@ -453,7 +453,17 @@ impl<'p, 'tcx> Matrix<'p, 'tcx> {
|
|||
/// expands it.
|
||||
fn push(&mut self, row: PatStack<'p, 'tcx>) {
|
||||
if !row.is_empty() && row.head().is_or_pat() {
|
||||
self.patterns.extend(row.expand_or_pat());
|
||||
let pats = row.expand_or_pat();
|
||||
let mut no_inner_or = true;
|
||||
for pat in pats {
|
||||
if !pat.is_empty() && pat.head().is_or_pat() {
|
||||
self.patterns.extend(pat.expand_or_pat());
|
||||
no_inner_or = false;
|
||||
}
|
||||
}
|
||||
if no_inner_or {
|
||||
self.patterns.extend(row.expand_or_pat());
|
||||
}
|
||||
} else {
|
||||
self.patterns.push(row);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue