mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Add pattern type for module params
This commit is contained in:
parent
90c7745989
commit
702092859e
3 changed files with 3 additions and 2 deletions
|
@ -401,8 +401,7 @@ pub fn canonicalize_module_defs<'a>(
|
||||||
var_store,
|
var_store,
|
||||||
&mut scope,
|
&mut scope,
|
||||||
&mut output,
|
&mut output,
|
||||||
// todo(agus): custom type for param
|
PatternType::ModuleParams,
|
||||||
PatternType::FunctionArg,
|
|
||||||
&pattern.value,
|
&pattern.value,
|
||||||
pattern.region,
|
pattern.region,
|
||||||
PermitShadows(false),
|
PermitShadows(false),
|
||||||
|
|
|
@ -25,6 +25,7 @@ pub enum PatternType {
|
||||||
DefExpr,
|
DefExpr,
|
||||||
FunctionArg,
|
FunctionArg,
|
||||||
WhenBranch,
|
WhenBranch,
|
||||||
|
ModuleParams,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn closure_param<'a>() -> impl Parser<'a, Loc<Pattern<'a>>, EPattern<'a>> {
|
pub fn closure_param<'a>() -> impl Parser<'a, Loc<Pattern<'a>>, EPattern<'a>> {
|
||||||
|
|
|
@ -390,6 +390,7 @@ pub fn can_problem<'b>(
|
||||||
TopLevelDef => "a top-level definition:",
|
TopLevelDef => "a top-level definition:",
|
||||||
DefExpr => "a value definition:",
|
DefExpr => "a value definition:",
|
||||||
FunctionArg => "function arguments:",
|
FunctionArg => "function arguments:",
|
||||||
|
ModuleParams => "module params:",
|
||||||
WhenBranch => unreachable!("all patterns are allowed in a When"),
|
WhenBranch => unreachable!("all patterns are allowed in a When"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue