mirror of
https://github.com/roc-lang/roc.git
synced 2024-08-17 06:41:22 +03:00
better documentation for underscore pattern
This commit is contained in:
parent
e0af069645
commit
64220567e5
@ -1677,6 +1677,10 @@ pub enum Pattern<'a> {
|
||||
},
|
||||
FloatLiteral(&'a str),
|
||||
StrLiteral(StrLiteral<'a>),
|
||||
|
||||
/// Underscore pattern
|
||||
/// Contains the name of underscore pattern (e.g. "a" is for "_a" in code)
|
||||
/// Empty string is unnamed pattern ("" is for "_" in code)
|
||||
Underscore(&'a str),
|
||||
SingleQuote(&'a str),
|
||||
|
||||
|
@ -76,7 +76,7 @@ pub fn jit_to_ast<'a, A: ReplApp<'a>>(
|
||||
|
||||
// Put in an underscore for each of the args, just to get the arity right.
|
||||
for _ in 0..arguments.len() {
|
||||
arg_patterns.push(Loc::at_zero(Pattern::Underscore("_")));
|
||||
arg_patterns.push(Loc::at_zero(Pattern::Underscore("")));
|
||||
}
|
||||
|
||||
let body_expr = Loc::at_zero(Expr::Record(Collection::empty()));
|
||||
|
Loading…
Reference in New Issue
Block a user