parent
ce346572fa
commit
cd907d71a3
@ -1,3 +1,4 @@
|
||||
/fd-find-6.0.0.crate
|
||||
/fd-find-6.2.0.crate
|
||||
/fd-find-6.3.0.crate
|
||||
/fd-find-7.0.0.crate
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 5616ca398ffa54643ae3c139518060d4523be687 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <cuviper@gmail.com>
|
||||
Date: Wed, 7 Mar 2018 21:48:02 -0800
|
||||
Subject: [PATCH] Update to regex-syntax 0.5
|
||||
|
||||
The new regex 0.2.7 has updated to regex-syntax 0.5, so it seems prudent
|
||||
to update fd's dependency too, if only to avoid duplication.
|
||||
---
|
||||
src/internal.rs | 28 +++++++++++++++++-----------
|
||||
1 file changed, 17 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/internal.rs b/src/internal.rs
|
||||
index fe9a43db5640..a2bb96a89772 100644
|
||||
--- a/src/internal.rs
|
||||
+++ b/src/internal.rs
|
||||
@@ -15,7 +15,8 @@ use std::io::Write;
|
||||
use exec::CommandTemplate;
|
||||
use lscolors::LsColors;
|
||||
use walk::FileType;
|
||||
-use regex_syntax::{Expr, ExprBuilder};
|
||||
+use regex_syntax::Parser;
|
||||
+use regex_syntax::hir::Hir;
|
||||
use regex::RegexSet;
|
||||
|
||||
/// Configuration options for *fd*.
|
||||
@@ -83,22 +84,27 @@ pub fn error(message: &str) -> ! {
|
||||
|
||||
/// Determine if a regex pattern contains a literal uppercase character.
|
||||
pub fn pattern_has_uppercase_char(pattern: &str) -> bool {
|
||||
- ExprBuilder::new()
|
||||
+ Parser::new()
|
||||
.parse(pattern)
|
||||
- .map(|expr| expr_has_uppercase_char(&expr))
|
||||
+ .map(|hir| hir_has_uppercase_char(&hir))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Determine if a regex expression contains a literal uppercase character.
|
||||
-fn expr_has_uppercase_char(expr: &Expr) -> bool {
|
||||
- match *expr {
|
||||
- Expr::Literal { ref chars, .. } => chars.iter().any(|c| c.is_uppercase()),
|
||||
- Expr::Class(ref ranges) => ranges
|
||||
+fn hir_has_uppercase_char(hir: &Hir) -> bool {
|
||||
+ use regex_syntax::hir::*;
|
||||
+
|
||||
+ match *hir.kind() {
|
||||
+ HirKind::Literal(Literal::Unicode(c)) => c.is_uppercase(),
|
||||
+ HirKind::Class(Class::Unicode(ref ranges)) => ranges
|
||||
.iter()
|
||||
- .any(|r| r.start.is_uppercase() || r.end.is_uppercase()),
|
||||
- Expr::Group { ref e, .. } | Expr::Repeat { ref e, .. } => expr_has_uppercase_char(e),
|
||||
- Expr::Concat(ref es) => es.iter().any(expr_has_uppercase_char),
|
||||
- Expr::Alternate(ref es) => es.iter().any(expr_has_uppercase_char),
|
||||
+ .any(|r| r.start().is_uppercase() || r.end().is_uppercase()),
|
||||
+ HirKind::Group(Group { ref hir, .. }) | HirKind::Repetition(Repetition { ref hir, .. }) => {
|
||||
+ hir_has_uppercase_char(hir)
|
||||
+ }
|
||||
+ HirKind::Concat(ref hirs) | HirKind::Alternation(ref hirs) => {
|
||||
+ hirs.iter().any(hir_has_uppercase_char)
|
||||
+ }
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,41 +0,0 @@
|
||||
--- fd-find-6.3.0/Cargo.toml 1969-12-31T16:00:00-08:00
|
||||
+++ fd-find-6.3.0/Cargo.toml 2018-03-08T10:21:06.328193-08:00
|
||||
@@ -28,7 +28,7 @@
|
||||
name = "fd"
|
||||
path = "src/main.rs"
|
||||
[dependencies.ansi_term]
|
||||
-version = "0.9"
|
||||
+version = "0.10"
|
||||
|
||||
[dependencies.atty]
|
||||
version = "0.2"
|
||||
@@ -41,7 +41,7 @@
|
||||
version = "3.0"
|
||||
|
||||
[dependencies.ignore]
|
||||
-version = "0.2"
|
||||
+version = "0.4"
|
||||
|
||||
[dependencies.lazy_static]
|
||||
version = "1"
|
||||
@@ -53,7 +53,7 @@
|
||||
version = "0.2"
|
||||
|
||||
[dependencies.regex-syntax]
|
||||
-version = "0.4"
|
||||
+version = "0.5"
|
||||
[dev-dependencies.diff]
|
||||
version = "0.1"
|
||||
|
||||
@@ -66,11 +66,7 @@
|
||||
version = "0.1.3"
|
||||
[target."cfg(all(unix, not(target_os = \"redox\")))".dependencies.libc]
|
||||
version = "0.2"
|
||||
-[target."cfg(windows)".dependencies.kernel32-sys]
|
||||
-version = "0.2"
|
||||
|
||||
-[target."cfg(windows)".dependencies.winapi]
|
||||
-version = "0.2"
|
||||
[badges.appveyor]
|
||||
repository = "sharkdp/fd"
|
||||
|
@ -0,0 +1,14 @@
|
||||
--- fd-find-7.0.0/Cargo.toml 1969-12-31T16:00:00-08:00
|
||||
+++ fd-find-7.0.0/Cargo.toml 2018-03-26T13:04:08.087983-07:00
|
||||
@@ -66,11 +66,6 @@
|
||||
version = "0.1.3"
|
||||
[target."cfg(all(unix, not(target_os = \"redox\")))".dependencies.libc]
|
||||
version = "0.2"
|
||||
-[target."cfg(windows)".dependencies.kernel32-sys]
|
||||
-version = "0.2"
|
||||
-
|
||||
-[target."cfg(windows)".dependencies.winapi]
|
||||
-version = "0.2"
|
||||
[badges.appveyor]
|
||||
repository = "sharkdp/fd"
|
||||
|
@ -1 +1 @@
|
||||
SHA512 (fd-find-6.3.0.crate) = 0eb9ecc62711a8c8bd42d0726767cc1b5a408fac7361eea3aa851a545e771fc55416b036473b84418c6a6dafb8efc038425cd1fce072aa02af6e527d85b12b41
|
||||
SHA512 (fd-find-7.0.0.crate) = 2f5ceb1d15cab45dc8a47e036fbcd9a754ae968ac7efd9592b72d801cb6ea03afdf1159c64d6b5868faba2258ab0509d23fe834df1e5ef3f978a0107141293d2
|
||||
|
Loading…
Reference in new issue