mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
expr: Remove nonexistent error UnmatchedClosingBrace
The closing brace without related opening brace is handled literally
This commit is contained in:
@@ -46,8 +46,6 @@ pub enum ExprError {
|
||||
UnmatchedClosingParenthesis,
|
||||
#[error("Unmatched \\{{")]
|
||||
UnmatchedOpeningBrace,
|
||||
#[error("Unmatched ) or \\}}")]
|
||||
UnmatchedClosingBrace,
|
||||
#[error("Invalid content of \\{{\\}}")]
|
||||
InvalidBracketContent,
|
||||
#[error("Trailing backslash")]
|
||||
|
||||
@@ -365,9 +365,7 @@ fn check_posix_regex_errors(pattern: &str) -> ExprResult<()> {
|
||||
}
|
||||
(true, '}') => {
|
||||
if !is_brace_ignored {
|
||||
escaped_braces = escaped_braces
|
||||
.saturating_sub(1)
|
||||
.ok_or(ExprError::UnmatchedClosingBrace)?;
|
||||
escaped_braces = escaped_braces.saturating_sub(1);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@@ -1007,12 +1005,6 @@ mod test {
|
||||
Err(ExprError::UnmatchedClosingParenthesis)
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
check_posix_regex_errors(r"abc\}"),
|
||||
Err(ExprError::UnmatchedClosingBrace)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_regex_empty_repeating_pattern() {
|
||||
assert_eq!(
|
||||
|
||||
Reference in New Issue
Block a user