File: multi_pattern_v2.rs

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,245,360 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (37 lines) | stat: -rw-r--r-- 1,539 bytes parent folder | download | duplicates (56)
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
// DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY:
//
//     regex-cli generate serialize sparse regex MULTI_PATTERN_V2 regex-automata/tests/gen/sparse/ --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::{regex::Regex, sparse::DFA},
    util::lazy::Lazy,
};

pub static MULTI_PATTERN_V2: Lazy<Regex<DFA<&'static [u8]>>> =
    Lazy::new(|| {
        let dfafwd = {
            #[cfg(target_endian = "big")]
            static BYTES: &'static [u8] =
                include_bytes!("multi_pattern_v2_fwd.bigendian.dfa");
            #[cfg(target_endian = "little")]
            static BYTES: &'static [u8] =
                include_bytes!("multi_pattern_v2_fwd.littleendian.dfa");
            DFA::from_bytes(BYTES)
                .expect("serialized forward DFA should be valid")
                .0
        };
        let dfarev = {
            #[cfg(target_endian = "big")]
            static BYTES: &'static [u8] =
                include_bytes!("multi_pattern_v2_rev.bigendian.dfa");
            #[cfg(target_endian = "little")]
            static BYTES: &'static [u8] =
                include_bytes!("multi_pattern_v2_rev.littleendian.dfa");
            DFA::from_bytes(BYTES)
                .expect("serialized reverse DFA should be valid")
                .0
        };
        Regex::builder().build_from_dfas(dfafwd, dfarev)
    });