mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:45:59 +02:00
early return for parsing closure and block with interchanged shape (#7618)
This commit is contained in:
@ -4176,7 +4176,7 @@ pub fn parse_closure_expression(
|
||||
} else {
|
||||
return (
|
||||
garbage(span),
|
||||
Some(ParseError::Expected("block".into(), span)),
|
||||
Some(ParseError::Expected("closure".into(), span)),
|
||||
);
|
||||
}
|
||||
if bytes.ends_with(b"}") {
|
||||
@ -4248,7 +4248,7 @@ pub fn parse_closure_expression(
|
||||
error = error.or_else(|| {
|
||||
Some(ParseError::Expected(
|
||||
format!(
|
||||
"{} block parameter{}",
|
||||
"{} closure parameter{}",
|
||||
v.len(),
|
||||
if v.len() > 1 { "s" } else { "" }
|
||||
),
|
||||
|
Reference in New Issue
Block a user