forked from extern/nushell
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
@ -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 New Issue
Block a user