replace the regex crate with the fancy-regex crate (#6227)

This commit is contained in:
Darren Schroeder
2022-08-04 14:51:02 -05:00
committed by GitHub
parent 606547ecb4
commit cdeb8de75d
20 changed files with 227 additions and 111 deletions

View File

@ -20,18 +20,18 @@ nu-utils = { path = "../nu-utils", version = "0.66.3" }
nu-ansi-term = "0.46.0"
nu-color-config = { path = "../nu-color-config", version = "0.66.3" }
reedline = { version = "0.9.0", features = ["bashisms", "sqlite"]}
crossterm = "0.24.0"
miette = { version = "5.1.0", features = ["fancy"] }
thiserror = "1.0.31"
fuzzy-matcher = "0.3.7"
chrono = "0.4.19"
crossterm = "0.24.0"
fancy-regex = "0.10.0"
fuzzy-matcher = "0.3.7"
is_executable = "1.0.1"
lazy_static = "1.4.0"
log = "0.4"
regex = "1.5.4"
miette = { version = "5.1.0", features = ["fancy"] }
strip-ansi-escapes = "0.1.1"
sysinfo = "0.24.1"
thiserror = "1.0.31"
[features]
plugin = []

View File

@ -5,6 +5,7 @@ use crate::{
util::{eval_source, get_guaranteed_cwd, report_error, report_error_new},
NuHighlighter, NuValidator, NushellPrompt,
};
use fancy_regex::Regex;
use lazy_static::lazy_static;
use log::{info, trace, warn};
use miette::{IntoDiagnostic, Result};
@ -18,7 +19,6 @@ use nu_protocol::{
Type, Value, VarId,
};
use reedline::{DefaultHinter, Emacs, SqliteBackedHistory, Vi};
use regex::Regex;
use std::io::{self, Write};
use std::{sync::atomic::Ordering, time::Instant};
use strip_ansi_escapes::strip;
@ -494,7 +494,7 @@ fn get_banner(engine_state: &mut EngineState, stack: &mut Stack) -> String {
let banner = format!(
r#"{} __ ,
{} .--()°'.' {}Welcome to {}Nushell{},
{} .--()°'.' {}Welcome to {}Nushell{},
{}'|, . ,' {}based on the {}nu{} language,
{} !_-(_\ {}where all data is structured!
@ -909,7 +909,7 @@ lazy_static! {
fn looks_like_path(orig: &str) -> bool {
#[cfg(windows)]
{
if DRIVE_PATH_REGEX.is_match(orig) {
if DRIVE_PATH_REGEX.is_match(orig).unwrap_or(false) {
return true;
}
}