forked from extern/nushell
error when closure param lists aren't terminated by |
(#14095)
Fixes #13757, fixes #9562 # User-Facing Changes - `unclosed |` is returned for malformed closure parameters: ``` { |a } ``` - Parameter list closing pipes are highlighted as part of the closure
This commit is contained in:
@ -4594,7 +4594,7 @@ pub fn parse_closure_expression(
|
||||
} = token.1
|
||||
{
|
||||
end_span = Some(span);
|
||||
amt_to_skip = token.0;
|
||||
amt_to_skip += token.0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4602,6 +4602,7 @@ pub fn parse_closure_expression(
|
||||
let end_point = if let Some(span) = end_span {
|
||||
span.end
|
||||
} else {
|
||||
working_set.error(ParseError::Unclosed("|".into(), Span::new(end, end)));
|
||||
end
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user