Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
use regex_automata::{Input, Match};
mod multi_pattern_v2;
#[test]
fn multi_pattern_v2() {
use multi_pattern_v2::MULTI_PATTERN_V2 as RE;
assert_eq!(Some(Match::must(0, 0..4)), RE.find("abcd"));
assert_eq!(Some(Match::must(0, 2..6)), RE.find("@ abcd @"));
assert_eq!(Some(Match::must(1, 0..6)), RE.find("@abcd@"));
assert_eq!(Some(Match::must(0, 1..5)), RE.find("\nabcd\n"));
assert_eq!(Some(Match::must(0, 1..5)), RE.find("\nabcd wxyz\n"));
assert_eq!(Some(Match::must(1, 1..7)), RE.find("\n@abcd@\n"));
assert_eq!(Some(Match::must(2, 0..6)), RE.find("@abcd@\r\n"));
assert_eq!(Some(Match::must(1, 2..8)), RE.find("\r\n@abcd@"));
assert_eq!(Some(Match::must(2, 2..8)), RE.find("\r\n@abcd@\r\n"));
// Fails because we have heuristic support for Unicode word boundaries
// enabled.
assert!(RE.try_search(&Input::new(b"\xFF@abcd@\xFF")).is_err());
}

View File

@@ -0,0 +1,43 @@
// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
//
// regex-cli generate serialize dense regex MULTI_PATTERN_V2 tests/gen/dense/ --rustfmt --safe --starts-for-each-pattern --specialize-start-states --start-kind both --unicode-word-boundary --minimize \b[a-zA-Z]+\b (?m)^\S+$ (?Rm)^\S+$
//
// regex-cli 0.0.1 is available on crates.io.
use regex_automata::{
dfa::{dense::DFA, regex::Regex},
util::{lazy::Lazy, wire::AlignAs},
};
pub static MULTI_PATTERN_V2: Lazy<Regex<DFA<&'static [u32]>>> =
Lazy::new(|| {
let dfafwd = {
static ALIGNED: &AlignAs<[u8], u32> = &AlignAs {
_align: [],
#[cfg(target_endian = "big")]
bytes: *include_bytes!("multi_pattern_v2_fwd.bigendian.dfa"),
#[cfg(target_endian = "little")]
bytes: *include_bytes!(
"multi_pattern_v2_fwd.littleendian.dfa"
),
};
DFA::from_bytes(&ALIGNED.bytes)
.expect("serialized forward DFA should be valid")
.0
};
let dfarev = {
static ALIGNED: &AlignAs<[u8], u32> = &AlignAs {
_align: [],
#[cfg(target_endian = "big")]
bytes: *include_bytes!("multi_pattern_v2_rev.bigendian.dfa"),
#[cfg(target_endian = "little")]
bytes: *include_bytes!(
"multi_pattern_v2_rev.littleendian.dfa"
),
};
DFA::from_bytes(&ALIGNED.bytes)
.expect("serialized reverse DFA should be valid")
.0
};
Regex::builder().build_from_dfas(dfafwd, dfarev)
});