mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +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
|
@ -37,7 +37,7 @@ impl<'a> Formattable<'a> for Pattern<'a> {
|
|||
| Pattern::NonBase10Literal { .. }
|
||||
| Pattern::FloatLiteral(_)
|
||||
| Pattern::StrLiteral(_)
|
||||
| Pattern::Underscore
|
||||
| Pattern::Underscore(_)
|
||||
| Pattern::Malformed(_)
|
||||
| Pattern::QualifiedIdentifier { .. } => false,
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ impl<'a> Formattable<'a> for Pattern<'a> {
|
|||
StrLiteral(literal) => {
|
||||
todo!("Format string literal: {:?}", literal);
|
||||
}
|
||||
Underscore => buf.push('_'),
|
||||
Underscore(name) => buf.push_str(name),
|
||||
|
||||
// Space
|
||||
SpaceBefore(sub_pattern, spaces) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue