mirror of
https://github.com/nushell/nushell
synced 2024-11-10 07:04:13 +00:00
Fix strange error on unbalanced curly braces (#8906)
# Description Fixes issue https://github.com/nushell/nushell/issues/8400 # User-Facing Changes Before ![image](https://user-images.githubusercontent.com/5063945/232443913-a8fe9f50-2014-4edd-95b0-516058566f64.png) After ![image](https://user-images.githubusercontent.com/5063945/232444266-375d9438-0688-4f49-a884-b8650110f7fe.png)
This commit is contained in:
parent
4ecec59224
commit
6eb00f6c60
2 changed files with 6 additions and 1 deletions
|
@ -191,7 +191,7 @@ pub fn lex_item(
|
|||
Some(ParseError::Unbalanced(
|
||||
"{".to_string(),
|
||||
"}".to_string(),
|
||||
Span::new(span.end, span.end),
|
||||
Span::new(span.end, span.end + 1),
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -488,6 +488,11 @@ fn unbalanced_delimiter3() -> TestResult {
|
|||
fail_test(r#"{"#, "Unexpected end of code")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unbalanced_delimiter4() -> TestResult {
|
||||
fail_test(r#"}"#, "unbalanced { and }")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn register_with_string_literal() -> TestResult {
|
||||
fail_test(r#"register 'nu-plugin-math'"#, "File not found")
|
||||
|
|
Loading…
Reference in a new issue