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