mirror of
https://github.com/nushell/nushell.git
synced 2025-03-26 23:36:20 +01:00
Fix strange error on unbalanced curly braces (#8906)
# Description Fixes issue https://github.com/nushell/nushell/issues/8400 # User-Facing Changes Before  After 
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