mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
feat(parse): support capturing a str in Pattern::Underscore
This commit is contained in:
parent
ce67f28c42
commit
8df5d5c13c
5 changed files with 15 additions and 12 deletions
|
@ -437,7 +437,7 @@ pub enum Pattern<'a> {
|
|||
},
|
||||
FloatLiteral(&'a str),
|
||||
StrLiteral(StrLiteral<'a>),
|
||||
Underscore,
|
||||
Underscore(&'a str),
|
||||
|
||||
// Space
|
||||
SpaceBefore(&'a Pattern<'a>, &'a [CommentOrNewline<'a>]),
|
||||
|
@ -554,7 +554,8 @@ impl<'a> Pattern<'a> {
|
|||
) => string_x == string_y && base_x == base_y && is_negative_x == is_negative_y,
|
||||
(FloatLiteral(x), FloatLiteral(y)) => x == y,
|
||||
(StrLiteral(x), StrLiteral(y)) => x == y,
|
||||
(Underscore, Underscore) => true,
|
||||
// TODO do we want to compare anything here?
|
||||
(Underscore(_), Underscore(_)) => true,
|
||||
|
||||
// Space
|
||||
(SpaceBefore(x, _), SpaceBefore(y, _)) => x.equivalent(y),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue