Canonicalization of list patterns

This commit is contained in:
Ayaz Hafiz 2022-10-31 11:57:02 -05:00
parent 55ea3bbea2
commit b0a8b85de3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
13 changed files with 189 additions and 4 deletions

View file

@ -472,6 +472,12 @@ pub fn walk_pattern<V: Visitor>(visitor: &mut V, pattern: &Pattern) {
RecordDestructure { destructs, .. } => destructs
.iter()
.for_each(|d| visitor.visit_record_destruct(&d.value, d.region)),
List {
patterns, elem_var, ..
} => patterns
.patterns
.iter()
.for_each(|p| visitor.visit_pattern(&p.value, p.region, Some(*elem_var))),
NumLiteral(..) => { /* terminal */ }
IntLiteral(..) => { /* terminal */ }
FloatLiteral(..) => { /* terminal */ }