Skip to content

Commit

Permalink
regex: remove old regex-syntax crate
Browse files Browse the repository at this point in the history
This commit does the mechanical changes necessary to remove the old
regex-syntax crate and replace it with the rewrite. The rewrite now
subsumes the `regex-syntax` crate name, and gets a semver bump to 0.5.0.
  • Loading branch information
BurntSushi committed Mar 8, 2018
1 parent efff9fa commit b3e5fd2
Show file tree
Hide file tree
Showing 40 changed files with 793 additions and 14,718 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ appveyor = { repository = "rust-lang-libs/regex" }

[workspace]
members = [
"bench", "regex-capi", "regex-debug", "regex-syntax", "regex-syntax-2",
"bench", "regex-capi", "regex-debug", "regex-syntax",
]

[dependencies]
Expand All @@ -30,8 +30,7 @@ memchr = "2.0.0"
# For managing regex caches quickly across multiple threads.
thread_local = "0.3.2"
# For parsing regular expressions.
regex-syntax = { path = "regex-syntax", version = "0.4.1" }
regex-syntax2 = { path = "regex-syntax-2", version = "0.5.0" }
regex-syntax = { path = "regex-syntax", version = "0.5.0" }
# For accelerating text search.
simd = { version = "0.2.1", optional = true }
# For compiling UTF-8 decoding into automata.
Expand Down
2 changes: 1 addition & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ onig = { version = "3", optional = true }
libpcre-sys = { version = "0.2", optional = true }
memmap = "0.6"
regex = { version = "0.2.0", path = "..", features = ["simd-accel"] }
regex-syntax = { version = "0.4.0", path = "../regex-syntax" }
regex-syntax = { version = "0.5.0", path = "../regex-syntax" }
serde = "1"
serde_derive = "1"

Expand Down
14 changes: 7 additions & 7 deletions bench/src/rust_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use regex_syntax::Expr;
use regex_syntax::Parser;
use test::Bencher;

use regex::internal::Compiler;

#[bench]
fn compile_simple(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"^bc(d|e)*$").unwrap();
let re = Parser::new().parse(r"^bc(d|e)*$").unwrap();
Compiler::new().compile(&[re]).unwrap()
});
}

#[bench]
fn compile_simple_bytes(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"^bc(d|e)*$").unwrap();
let re = Parser::new().parse(r"^bc(d|e)*$").unwrap();
Compiler::new().bytes(true).compile(&[re]).unwrap()
});
}
Expand All @@ -39,15 +39,15 @@ fn compile_simple_full(b: &mut Bencher) {
#[bench]
fn compile_small(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"\p{L}|\p{N}|\s|.|\d").unwrap();
let re = Parser::new().parse(r"\p{L}|\p{N}|\s|.|\d").unwrap();
Compiler::new().compile(&[re]).unwrap()
});
}

#[bench]
fn compile_small_bytes(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"\p{L}|\p{N}|\s|.|\d").unwrap();
let re = Parser::new().parse(r"\p{L}|\p{N}|\s|.|\d").unwrap();
Compiler::new().bytes(true).compile(&[re]).unwrap()
});
}
Expand All @@ -62,15 +62,15 @@ fn compile_small_full(b: &mut Bencher) {
#[bench]
fn compile_huge(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"\p{L}{100}").unwrap();
let re = Parser::new().parse(r"\p{L}{100}").unwrap();
Compiler::new().compile(&[re]).unwrap()
});
}

#[bench]
fn compile_huge_bytes(b: &mut Bencher) {
b.iter(|| {
let re = Expr::parse(r"\p{L}{100}").unwrap();
let re = Parser::new().parse(r"\p{L}{100}").unwrap();
Compiler::new().bytes(true).compile(&[re]).unwrap()
});
}
Expand Down
3 changes: 1 addition & 2 deletions regex-debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ workspace = ".."
[dependencies]
docopt = "0.8"
regex = { version = "0.2", path = ".." }
regex-syntax = { version = "0.4.0", path = "../regex-syntax" }
regex-syntax2 = { version = "0.5.0", path = "../regex-syntax-2" }
regex-syntax = { version = "0.5.0", path = "../regex-syntax" }
serde = "1"
serde_derive = "1"
utf8-ranges = "1"
2 changes: 1 addition & 1 deletion regex-debug/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern crate docopt;
extern crate regex;
extern crate regex_syntax2 as syntax;
extern crate regex_syntax as syntax;
extern crate serde;
#[macro_use]
extern crate serde_derive;
Expand Down
13 changes: 0 additions & 13 deletions regex-syntax-2/Cargo.toml

This file was deleted.

73 changes: 0 additions & 73 deletions regex-syntax-2/benches/bench.rs

This file was deleted.

Loading

0 comments on commit b3e5fd2

Please sign in to comment.