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
|
@ -666,7 +666,7 @@ fn annotation_or_alias<'a>(
|
|||
NumLiteral(_) | NonBase10Literal { .. } | FloatLiteral(_) | StrLiteral(_) => {
|
||||
Def::NotYetImplemented("TODO gracefully handle trying to annotate a litera")
|
||||
}
|
||||
Underscore => {
|
||||
Underscore(_) => {
|
||||
Def::NotYetImplemented("TODO gracefully handle trying to give a type annotation to an undrscore")
|
||||
}
|
||||
Malformed(_) => {
|
||||
|
@ -1086,7 +1086,9 @@ fn string_pattern<'a>() -> impl Parser<'a, Pattern<'a>> {
|
|||
}
|
||||
|
||||
fn underscore_pattern<'a>() -> impl Parser<'a, Pattern<'a>> {
|
||||
map!(ascii_char(b'_'), |_| Pattern::Underscore)
|
||||
map_with_arena!(ascii_char(b'_'), |_arena, _thing| {
|
||||
Pattern::Underscore(&"_")
|
||||
})
|
||||
}
|
||||
|
||||
fn record_destructure<'a>(min_indent: u16) -> impl Parser<'a, Pattern<'a>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue