mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
refactor PatternAs
This commit is contained in:
parent
e9196f3c0b
commit
aff70bb6bd
6 changed files with 94 additions and 52 deletions
|
@ -689,7 +689,7 @@ pub fn canonicalize_pattern<'a>(
|
|||
|
||||
for (i, loc_pattern) in patterns.iter().enumerate() {
|
||||
match &loc_pattern.value {
|
||||
ListRest => match rest_index {
|
||||
ListRest(_opt_pattern_as) => match rest_index {
|
||||
None => {
|
||||
rest_index = Some(i);
|
||||
}
|
||||
|
@ -731,14 +731,14 @@ pub fn canonicalize_pattern<'a>(
|
|||
},
|
||||
})
|
||||
}
|
||||
ListRest => {
|
||||
ListRest(_opt_pattern_as) => {
|
||||
// Parsing should make sure these only appear in list patterns, where we will generate
|
||||
// better contextual errors.
|
||||
let problem = MalformedPatternProblem::Unknown;
|
||||
malformed_pattern(env, problem, region)
|
||||
}
|
||||
|
||||
As(_pattern, _spaces, _identifier) => {
|
||||
As(_pattern, _pattern_as) => {
|
||||
todo!();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue