mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Support underscore assignments in roc_ast
This commit is contained in:
parent
cb42d9b076
commit
e20b5f6ee1
1 changed files with 1 additions and 14 deletions
|
@ -171,10 +171,7 @@ pub fn to_pattern2<'a>(
|
|||
malformed_pattern(env, problem, region)
|
||||
}
|
||||
|
||||
Underscore(_) => match pattern_type {
|
||||
WhenBranch | FunctionArg => Pattern2::Underscore,
|
||||
TopLevelDef | DefExpr => underscore_in_def(env, region),
|
||||
},
|
||||
Underscore(_) => Pattern2::Underscore,
|
||||
|
||||
FloatLiteral(ref string) => match pattern_type {
|
||||
WhenBranch => match finish_parsing_float(string) {
|
||||
|
@ -591,16 +588,6 @@ fn unsupported_pattern<'a>(
|
|||
Pattern2::UnsupportedPattern(region)
|
||||
}
|
||||
|
||||
fn underscore_in_def<'a>(env: &mut Env<'a>, region: Region) -> Pattern2 {
|
||||
use roc_problem::can::BadPattern;
|
||||
env.problem(Problem::UnsupportedPattern(
|
||||
BadPattern::UnderscoreInDef,
|
||||
region,
|
||||
));
|
||||
|
||||
Pattern2::UnsupportedPattern(region)
|
||||
}
|
||||
|
||||
pub(crate) fn flatten_str_literal(pool: &mut Pool, literal: &StrLiteral<'_>) -> Pattern2 {
|
||||
use roc_parse::ast::StrLiteral::*;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue