mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
check point for review
This commit is contained in:
parent
8df5d5c13c
commit
0088080636
1 changed files with 12 additions and 3 deletions
|
|
@ -1086,9 +1086,18 @@ fn string_pattern<'a>() -> impl Parser<'a, Pattern<'a>> {
|
|||
}
|
||||
|
||||
fn underscore_pattern<'a>() -> impl Parser<'a, Pattern<'a>> {
|
||||
map_with_arena!(ascii_char(b'_'), |_arena, _thing| {
|
||||
Pattern::Underscore(&"_")
|
||||
})
|
||||
move |arena: &'a Bump, state: State<'a>| {
|
||||
let (_, next_state) = ascii_char(b'_').parse(arena, state)?;
|
||||
|
||||
let (output, final_state) = lowercase_ident().parse(arena, next_state)?;
|
||||
|
||||
let mut name = String::new_in(arena);
|
||||
|
||||
name.push('_');
|
||||
name.push_str(output);
|
||||
|
||||
Ok((Pattern::Underscore(&"_"), final_state))
|
||||
}
|
||||
}
|
||||
|
||||
fn record_destructure<'a>(min_indent: u16) -> impl Parser<'a, Pattern<'a>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue