forked from rust-lang/regex
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cargo.toml
195 lines (163 loc) · 5.88 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
[package]
name = "regex"
version = "1.3.9" #:version
authors = ["The Rust Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/rust-lang/regex"
documentation = "https://docs.rs/regex"
homepage = "https://github.com/rust-lang/regex"
description = """
An implementation of regular expressions for Rust. This implementation uses
finite automata and guarantees linear time matching on all inputs.
"""
categories = ["text-processing"]
autotests = false
exclude = ["/scripts/*", "/.github/*"]
[workspace]
members = [
"bench", "regex-capi", "regex-debug", "regex-syntax",
]
[lib]
# There are no benchmarks in the library code itself
bench = false
# Doc tests fail when some features aren't present. The easiest way to work
# around this is to disable automatic doc testing, but explicitly test them
# with `cargo test --doc`.
doctest = false
# Features are documented in the "Crate features" section of the crate docs:
# https://docs.rs/regex/*/#crate-features
[features]
default = ["std", "perf", "unicode", "regex-syntax/default"]
# ECOSYSTEM FEATURES
# The 'std' feature permits the regex crate to use the standard library. This
# is intended to support future use cases where the regex crate may be able
# to compile without std, and instead just rely on 'core' and 'alloc' (for
# example). Currently, this isn't supported, and removing the 'std' feature
# will prevent regex from compiling.
std = []
# The 'use_std' feature is DEPRECATED. It will be removed in regex 2. Until
# then, it is an alias for the 'std' feature.
use_std = ["std"]
# PERFORMANCE FEATURES
# Enables all performance features.
perf = ["perf-cache", "perf-dfa", "perf-inline", "perf-literal"]
# Enables fast caching. (If disabled, caching is still used, but is slower.)
perf-cache = ["thread_local"]
# Enables use of a lazy DFA when possible.
perf-dfa = []
# Enables aggressive use of inlining.
perf-inline = []
# Enables literal optimizations.
perf-literal = ["aho-corasick", "memchr"]
# UNICODE DATA FEATURES
# Enables all Unicode features. This expands if new Unicode features are added.
unicode = [
"unicode-age",
"unicode-bool",
"unicode-case",
"unicode-gencat",
"unicode-perl",
"unicode-script",
"unicode-segment",
"regex-syntax/unicode",
]
# Enables use of the `Age` property, e.g., `\p{Age:3.0}`.
unicode-age = ["regex-syntax/unicode-age"]
# Enables use of a smattering of boolean properties, e.g., `\p{Emoji}`.
unicode-bool = ["regex-syntax/unicode-bool"]
# Enables Unicode-aware case insensitive matching, e.g., `(?i)β`.
unicode-case = ["regex-syntax/unicode-case"]
# Enables Unicode general categories, e.g., `\p{Letter}` or `\pL`.
unicode-gencat = ["regex-syntax/unicode-gencat"]
# Enables Unicode-aware Perl classes corresponding to `\w`, `\s` and `\d`.
unicode-perl = ["regex-syntax/unicode-perl"]
# Enables Unicode scripts and script extensions, e.g., `\p{Greek}`.
unicode-script = ["regex-syntax/unicode-script"]
# Enables Unicode segmentation properties, e.g., `\p{gcb=Extend}`.
unicode-segment = ["regex-syntax/unicode-segment"]
# UNSTABLE FEATURES (requires Rust nightly)
# A blanket feature that governs whether unstable features are enabled or not.
# Unstable features are disabled by default, and typically rely on unstable
# features in rustc itself.
unstable = ["pattern"]
# Enable to use the unstable pattern traits defined in std. This is enabled
# by default if the unstable feature is enabled.
pattern = []
# For very fast prefix literal matching.
[dependencies.aho-corasick]
version = "0.7.6"
optional = true
# For skipping along search text quickly when a leading byte is known.
[dependencies.memchr]
version = "2.2.1"
optional = true
# For managing regex caches quickly across multiple threads.
[dependencies.thread_local]
version = "1"
optional = true
# For parsing regular expressions.
[dependencies.regex-syntax]
path = "regex-syntax"
version = "0.6.18"
default-features = false
[dev-dependencies]
# For examples.
lazy_static = "1"
# For property based tests.
quickcheck = { version = "0.8", default-features = false }
# For generating random test data.
rand = "0.6.5"
# To check README's example
# TODO: Re-enable this once the MSRV is 1.43 or greater.
# See: https://github.com/rust-lang/regex/issues/684
# See: https://github.com/rust-lang/regex/issues/685
# doc-comment = "0.3"
# Run the test suite on the default behavior of Regex::new.
# This includes a mish mash of NFAs and DFAs, which are chosen automatically
# based on the regex. We test both of the NFA implementations by forcing their
# usage with the test definitions below. (We can't test the DFA implementations
# in the same way since they can't be used for every regex tested.)
[[test]]
path = "tests/test_default.rs"
name = "default"
# The same as the default tests, but run on bytes::Regex.
[[test]]
path = "tests/test_default_bytes.rs"
name = "default-bytes"
# Run the test suite on the NFA algorithm over Unicode codepoints.
[[test]]
path = "tests/test_nfa.rs"
name = "nfa"
# Run the test suite on the NFA algorithm over bytes that match UTF-8 only.
[[test]]
path = "tests/test_nfa_utf8bytes.rs"
name = "nfa-utf8bytes"
# Run the test suite on the NFA algorithm over arbitrary bytes.
[[test]]
path = "tests/test_nfa_bytes.rs"
name = "nfa-bytes"
# Run the test suite on the backtracking engine over Unicode codepoints.
[[test]]
path = "tests/test_backtrack.rs"
name = "backtrack"
# Run the test suite on the backtracking engine over bytes that match UTF-8
# only.
[[test]]
path = "tests/test_backtrack_utf8bytes.rs"
name = "backtrack-utf8bytes"
# Run the test suite on the backtracking engine over arbitrary bytes.
[[test]]
path = "tests/test_backtrack_bytes.rs"
name = "backtrack-bytes"
# Run all backends against each regex found on crates.io and make sure
# that they all do the same thing.
[[test]]
path = "tests/test_crates_regex.rs"
name = "crates-regex"
[profile.release]
debug = true
[profile.bench]
debug = true
[profile.test]
debug = true