mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
expr: Remove nonexistent error UnmatchedClosingBrace
The closing brace without related opening brace is handled literally
This commit is contained in:
parent
bbc912eb75
commit
874a9304cf
2 changed files with 1 additions and 11 deletions
|
@ -46,8 +46,6 @@ pub enum ExprError {
|
||||||
UnmatchedClosingParenthesis,
|
UnmatchedClosingParenthesis,
|
||||||
#[error("Unmatched \\{{")]
|
#[error("Unmatched \\{{")]
|
||||||
UnmatchedOpeningBrace,
|
UnmatchedOpeningBrace,
|
||||||
#[error("Unmatched ) or \\}}")]
|
|
||||||
UnmatchedClosingBrace,
|
|
||||||
#[error("Invalid content of \\{{\\}}")]
|
#[error("Invalid content of \\{{\\}}")]
|
||||||
InvalidBracketContent,
|
InvalidBracketContent,
|
||||||
#[error("Trailing backslash")]
|
#[error("Trailing backslash")]
|
||||||
|
|
|
@ -365,9 +365,7 @@ fn check_posix_regex_errors(pattern: &str) -> ExprResult<()> {
|
||||||
}
|
}
|
||||||
(true, '}') => {
|
(true, '}') => {
|
||||||
if !is_brace_ignored {
|
if !is_brace_ignored {
|
||||||
escaped_braces = escaped_braces
|
escaped_braces = escaped_braces.saturating_sub(1);
|
||||||
.saturating_sub(1)
|
|
||||||
.ok_or(ExprError::UnmatchedClosingBrace)?;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -1007,12 +1005,6 @@ mod test {
|
||||||
Err(ExprError::UnmatchedClosingParenthesis)
|
Err(ExprError::UnmatchedClosingParenthesis)
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
check_posix_regex_errors(r"abc\}"),
|
|
||||||
Err(ExprError::UnmatchedClosingBrace)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn check_regex_empty_repeating_pattern() {
|
fn check_regex_empty_repeating_pattern() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue