Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,7 @@ notify = { version = "8.2.0", features = ["macos_kqueue"] }
num-bigint = "0.4.4"
num-prime = "0.5.0"
num-traits = "0.2.19"
fancy-regex = { version = "0.19.2", default-features = false, features = [
"std",
"unicode",
"leftmost_longest",
] }
fancy-regex = { version = "0.19.2", default-features = false }
os_display = "0.1.3"
parse_datetime = "0.16.0"
phf = "0.14.0"
Expand Down
2 changes: 1 addition & 1 deletion fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/uu/expr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ doctest = false
clap = { workspace = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }
fancy-regex = { workspace = true, default-features = false }
uucore = { workspace = true, features = ["i18n-collator"] }
uucore = { workspace = true, features = ["i18n-collator", "regex"] }
thiserror = { workspace = true }
fluent = { workspace = true }

Expand Down
7 changes: 0 additions & 7 deletions src/uu/expr/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,8 @@ expr-error-missing-argument = syntax error: missing argument after { $arg }
expr-error-non-integer-argument = non-integer argument
expr-error-missing-operand = missing operand
expr-error-division-by-zero = division by zero
expr-error-invalid-regex-expression = Invalid regex expression
expr-error-expected-closing-brace-after = syntax error: expecting ')' after { $arg }
expr-error-expected-closing-brace-instead-of = syntax error: expecting ')' instead of { $arg }
expr-error-unmatched-opening-parenthesis = Unmatched ( or \(
expr-error-unmatched-closing-parenthesis = Unmatched ) or \)
expr-error-unmatched-opening-brace = Unmatched {"\\{"}
expr-error-invalid-bracket-content = Invalid content of {"\\{\\}"}
expr-error-trailing-backslash = Trailing backslash
expr-error-too-big-range-quantifier-index = Regular expression too big
expr-error-match-utf8 = match does not support invalid UTF-8 encoding in { $arg }

# Diagnostic labels, used when errors are rendered with a source snippet
Expand Down
7 changes: 0 additions & 7 deletions src/uu/expr/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,8 @@ expr-error-missing-argument = erreur de syntaxe : argument manquant après { $ar
expr-error-non-integer-argument = argument non entier
expr-error-missing-operand = opérande manquant
expr-error-division-by-zero = division par zéro
expr-error-invalid-regex-expression = Expression regex invalide
expr-error-expected-closing-brace-after = erreur de syntaxe : ')' attendu après { $arg }
expr-error-expected-closing-brace-instead-of = erreur de syntaxe : ')' attendu au lieu de { $arg }
expr-error-unmatched-opening-parenthesis = Parenthèse ouvrante ( ou \( non appariée
expr-error-unmatched-closing-parenthesis = Parenthèse fermante ) ou \) non appariée
expr-error-unmatched-opening-brace = Accolade ouvrante {"\\{"} non appariée
expr-error-invalid-bracket-content = Contenu invalide de {"\\{\\}"}
expr-error-trailing-backslash = Barre oblique inverse en fin
expr-error-too-big-range-quantifier-index = Expression régulière trop grande
expr-error-match-utf8 = match ne supporte pas l'encodage UTF-8 invalide dans { $arg }

# Étiquettes de diagnostic, utilisées quand les erreurs sont rendues avec un extrait
Expand Down
8 changes: 1 addition & 7 deletions src/uu/expr/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,7 @@ fn locate(snapshot: &Snapshot, err: &ExprError, at: &FailurePoint) -> Option<Loc
// single out.
ExprError::MissingOperand
| ExprError::DivisionByZero
| ExprError::InvalidRegexExpression
| ExprError::UnmatchedOpeningParenthesis
| ExprError::UnmatchedClosingParenthesis
| ExprError::UnmatchedOpeningBrace
| ExprError::InvalidBracketContent
| ExprError::TrailingBackslash
| ExprError::TooBigRangeQuantifierIndex
| ExprError::Regex(_)
| ExprError::UnsupportedNonUtf8Match(_) => return None,
};

Expand Down
16 changes: 2 additions & 14 deletions src/uu/expr/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,14 @@ pub enum ExprError {
MissingOperand,
#[error("{}", translate!("expr-error-division-by-zero"))]
DivisionByZero,
#[error("{}", translate!("expr-error-invalid-regex-expression"))]
InvalidRegexExpression,
#[error("{}", translate!("expr-error-expected-closing-brace-after", "arg" => _0.quote()))]
ExpectedClosingBraceAfter(String),
#[error("{}", translate!("expr-error-expected-closing-brace-instead-of", "arg" => _0.quote()))]
ExpectedClosingBraceInsteadOf(String),
#[error("{}", translate!("expr-error-unmatched-opening-parenthesis"))]
UnmatchedOpeningParenthesis,
#[error("{}", translate!("expr-error-unmatched-closing-parenthesis"))]
UnmatchedClosingParenthesis,
#[error("{}", translate!("expr-error-unmatched-opening-brace"))]
UnmatchedOpeningBrace,
#[error("{}", translate!("expr-error-invalid-bracket-content"))]
InvalidBracketContent,
#[error("{}", translate!("expr-error-trailing-backslash"))]
TrailingBackslash,
#[error("{}", translate!("expr-error-too-big-range-quantifier-index"))]
TooBigRangeQuantifierIndex,
#[error("{}", translate!("expr-error-match-utf8", "arg" => _0.quote()))]
UnsupportedNonUtf8Match(String),
#[error(transparent)]
Regex(#[from] uucore::regex::RegexError),
}

impl UError for ExprError {
Expand Down
Loading
Loading