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
|
[package]
name = "regex-automata"
version = "0.4.13" #:version
authors = ["The Rust Project Developers", "Andrew Gallant <jamslam@gmail.com>"]
description = "Automata construction and matching using regular expressions."
documentation = "https://docs.rs/regex-automata"
homepage = "https://github.com/rust-lang/regex/tree/master/regex-automata"
repository = "https://github.com/rust-lang/regex"
readme = "README.md"
keywords = ["regex", "dfa", "automata", "automaton", "nfa"]
license = "MIT OR Apache-2.0"
categories = ["text-processing"]
edition = "2021"
autoexamples = false
rust-version = "1.65"
[lib]
bench = false
# This crate has many many many features. See the crate docs for a description
# of each and when you might want to use them.
[features]
default = ["std", "syntax", "perf", "unicode", "meta", "nfa", "dfa", "hybrid"]
std = ["regex-syntax?/std", "memchr?/std", "aho-corasick?/std", "alloc"]
alloc = []
logging = ["dep:log", "aho-corasick?/logging", "memchr?/logging"]
syntax = ["dep:regex-syntax", "alloc"]
meta = ["syntax", "nfa-pikevm"]
nfa = ["nfa-thompson", "nfa-pikevm", "nfa-backtrack"]
nfa-thompson = ["alloc"]
nfa-pikevm = ["nfa-thompson"]
nfa-backtrack = ["nfa-thompson"]
dfa = ["dfa-build", "dfa-search", "dfa-onepass"]
dfa-build = ["nfa-thompson", "dfa-search"]
dfa-search = []
dfa-onepass = ["nfa-thompson"]
hybrid = ["alloc", "nfa-thompson"]
perf = ["perf-inline", "perf-literal"]
perf-inline = []
perf-literal = ["perf-literal-substring", "perf-literal-multisubstring"]
perf-literal-substring = ["aho-corasick?/perf-literal", "dep:memchr"]
perf-literal-multisubstring = ["dep:aho-corasick"]
# 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",
"unicode-word-boundary",
"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"]
# Enables Unicode word boundary support. If this is enabled with unicode-perl,
# then data tables from regex-syntax are used. Otherwise, a new data table
# inside regex-automata will be included.
unicode-word-boundary = []
# These are strictly internal features that may be removed or changed in
# non-compatible ways.
internal-instrument = ["internal-instrument-pikevm"]
internal-instrument-pikevm = ["logging", "std"]
[dependencies]
aho-corasick = { version = "1.0.0", optional = true, default-features = false }
log = { version = "0.4.14", optional = true }
memchr = { version = "2.6.0", optional = true, default-features = false }
regex-syntax = { path = "../regex-syntax", version = "0.8.5", optional = true, default-features = false }
[dev-dependencies]
anyhow = "1.0.69"
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
doc-comment = "0.3.3"
quickcheck = { version = "1.0.3", default-features = false }
regex-test = { path = "../regex-test", version = "0.1.0" }
[dev-dependencies.env_logger]
version = "0.9.3"
default-features = false
features = ["atty", "humantime", "termcolor"]
# We put these tests here because they are written primarily against the
# regex-automata API, and in particular use regex-automata features for
# conditional compilation. If we moved these up as tests on 'regex' proper,
# then we'd need to duplicate regex-automata's complex features on 'regex' too,
# which I really do not want to do.
[[test]]
path = "tests/lib.rs"
name = "integration"
[package.metadata.docs.rs]
# We want to document all features.
all-features = true
# Since this crate's feature setup is pretty complicated, it is worth opting
# into a nightly unstable option to show the features that need to be enabled
# for public API items. To do that, we set 'docsrs_regex', and when that's
# enabled, we enable the 'doc_cfg' feature.
#
# To test this locally, run:
#
# RUSTDOCFLAGS="--cfg docsrs_regex" cargo +nightly doc --all-features
#
# Note that we use `docsrs_regex` instead of the more standard `docsrs` because
# other crates use that same `cfg` knob. And since we are enabling a nightly
# feature, they sometimes break. By using our "own" `cfg` knob, we are closer
# to being masters of our own destiny.
rustdoc-args = ["--cfg", "docsrs_regex"]
# This squashes the (AFAIK) erroneous warning that `docsrs_regex` is not a
# valid `cfg` knob.
[lints.rust]
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(docsrs_regex)'] }
|