diff options
Diffstat (limited to 'vendor/bstr/src/unicode/fsm')
24 files changed, 122 insertions, 283 deletions
diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.bigendian.dfa b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.bigendian.dfa Binary files differindex 31f99c1f5..c4321e2c9 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa Binary files differindex 3a51728bb..3b9905da9 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs index dea4a7e3e..ccba7d952 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_fwd.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name GRAPHEME_BREAK_FWD --sparse --minimize --anchored --state-size 2 src/unicode/fsm/ [snip (arg too long)] +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe GRAPHEME_BREAK_FWD src/unicode/fsm/ <snip: arg too long> // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static GRAPHEME_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("grapheme_break_fwd.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static GRAPHEME_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("grapheme_break_fwd.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static GRAPHEME_BREAK_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_fwd.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_fwd.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.bigendian.dfa b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.bigendian.dfa Binary files differindex 742d2a6a2..5d7d34a01 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.littleendian.dfa b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.littleendian.dfa Binary files differindex d1937f26c..7472844d4 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs index 2d2cd542f..e5619b2f0 100644 --- a/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs +++ b/vendor/bstr/src/unicode/fsm/grapheme_break_rev.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name GRAPHEME_BREAK_REV --reverse --longest --sparse --minimize --anchored --state-size 2 src/unicode/fsm/ [snip (arg too long)] +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --reverse --match-kind all --no-captures --shrink --rustfmt --safe GRAPHEME_BREAK_REV src/unicode/fsm/ <snip: arg too long> // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static GRAPHEME_BREAK_REV: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("grapheme_break_rev.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static GRAPHEME_BREAK_REV: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("grapheme_break_rev.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static GRAPHEME_BREAK_REV: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_rev.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("grapheme_break_rev.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); diff --git a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.bigendian.dfa b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.bigendian.dfa Binary files differindex 1a3357f71..1f830009a 100644 --- a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.littleendian.dfa b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.littleendian.dfa Binary files differindex e437aae3a..b0db99dd1 100644 --- a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs index db7a40fcd..af1c73051 100644 --- a/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs +++ b/vendor/bstr/src/unicode/fsm/regional_indicator_rev.rs @@ -1,41 +1,24 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name REGIONAL_INDICATOR_REV --reverse --classes --minimize --anchored --premultiply --state-size 1 src/unicode/fsm/ \p{gcb=Regional_Indicator} +// regex-cli generate serialize dense dfa --minimize --start-kind anchored --reverse --no-captures --shrink --rustfmt --safe REGIONAL_INDICATOR_REV src/unicode/fsm/ \p{gcb=Regional_Indicator} // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static REGIONAL_INDICATOR_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{ + dfa::dense::DFA, + util::{lazy::Lazy, wire::AlignAs}, +}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("regional_indicator_rev.bigendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static REGIONAL_INDICATOR_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("regional_indicator_rev.littleendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); +pub static REGIONAL_INDICATOR_REV: Lazy<DFA<&'static [u32]>> = + Lazy::new(|| { + static ALIGNED: &AlignAs<[u8], u32> = &AlignAs { + _align: [], + #[cfg(target_endian = "big")] + bytes: *include_bytes!("regional_indicator_rev.bigendian.dfa"), + #[cfg(target_endian = "little")] + bytes: *include_bytes!("regional_indicator_rev.littleendian.dfa"), + }; + let (dfa, _) = DFA::from_bytes(&ALIGNED.bytes) + .expect("serialized DFA should be valid"); + dfa + }); diff --git a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.bigendian.dfa b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.bigendian.dfa Binary files differindex 1abdae880..d4bd841e5 100644 --- a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.littleendian.dfa b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.littleendian.dfa Binary files differindex 2f8aadd30..df1e9521d 100644 --- a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.rs b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.rs index 97dd658e4..0f22eeefb 100644 --- a/vendor/bstr/src/unicode/fsm/sentence_break_fwd.rs +++ b/vendor/bstr/src/unicode/fsm/sentence_break_fwd.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name SENTENCE_BREAK_FWD --minimize --sparse --anchored --state-size 4 src/unicode/fsm/ [snip (arg too long)] +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe SENTENCE_BREAK_FWD src/unicode/fsm/ <snip: arg too long> // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static SENTENCE_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u32>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("sentence_break_fwd.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static SENTENCE_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u32>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("sentence_break_fwd.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static SENTENCE_BREAK_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("sentence_break_fwd.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("sentence_break_fwd.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); diff --git a/vendor/bstr/src/unicode/fsm/simple_word_fwd.bigendian.dfa b/vendor/bstr/src/unicode/fsm/simple_word_fwd.bigendian.dfa Binary files differindex 888e46599..08981bdd0 100644 --- a/vendor/bstr/src/unicode/fsm/simple_word_fwd.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/simple_word_fwd.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/simple_word_fwd.littleendian.dfa b/vendor/bstr/src/unicode/fsm/simple_word_fwd.littleendian.dfa Binary files differindex a1d527c74..daf01d60c 100644 --- a/vendor/bstr/src/unicode/fsm/simple_word_fwd.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/simple_word_fwd.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs b/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs index 32b69b611..97bd006fb 100644 --- a/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs +++ b/vendor/bstr/src/unicode/fsm/simple_word_fwd.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name SIMPLE_WORD_FWD --sparse --minimize --state-size 2 src/unicode/fsm/ \w +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe SIMPLE_WORD_FWD src/unicode/fsm/ \w // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static SIMPLE_WORD_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("simple_word_fwd.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static SIMPLE_WORD_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("simple_word_fwd.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static SIMPLE_WORD_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("simple_word_fwd.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("simple_word_fwd.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.bigendian.dfa b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.bigendian.dfa Binary files differindex bcfc4e9a1..fe32b0d98 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa Binary files differindex d534a464a..0179b66f7 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.rs b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.rs index 0780412ae..193deb0ca 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.rs +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_fwd.rs @@ -1,41 +1,24 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name WHITESPACE_ANCHORED_FWD --anchored --classes --premultiply --minimize --state-size 1 src/unicode/fsm/ \s+ +// regex-cli generate serialize dense dfa --minimize --start-kind anchored --shrink --rustfmt --safe WHITESPACE_ANCHORED_FWD src/unicode/fsm/ \s+ // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static WHITESPACE_ANCHORED_FWD: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{ + dfa::dense::DFA, + util::{lazy::Lazy, wire::AlignAs}, +}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("whitespace_anchored_fwd.bigendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static WHITESPACE_ANCHORED_FWD: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u8], u8>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("whitespace_anchored_fwd.littleendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); +pub static WHITESPACE_ANCHORED_FWD: Lazy<DFA<&'static [u32]>> = + Lazy::new(|| { + static ALIGNED: &AlignAs<[u8], u32> = &AlignAs { + _align: [], + #[cfg(target_endian = "big")] + bytes: *include_bytes!("whitespace_anchored_fwd.bigendian.dfa"), + #[cfg(target_endian = "little")] + bytes: *include_bytes!("whitespace_anchored_fwd.littleendian.dfa"), + }; + let (dfa, _) = DFA::from_bytes(&ALIGNED.bytes) + .expect("serialized DFA should be valid"); + dfa + }); diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.bigendian.dfa b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.bigendian.dfa Binary files differindex 427d3a922..cf8ef736b 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa Binary files differindex 7cc3a0a99..740fcd040 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.rs b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.rs index 3d0d7a661..2eb98c0bd 100644 --- a/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.rs +++ b/vendor/bstr/src/unicode/fsm/whitespace_anchored_rev.rs @@ -1,41 +1,24 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name WHITESPACE_ANCHORED_REV --reverse --anchored --classes --premultiply --minimize --state-size 2 src/unicode/fsm/ \s+ +// regex-cli generate serialize dense dfa --minimize --start-kind anchored --reverse --no-captures --shrink --rustfmt --safe WHITESPACE_ANCHORED_REV src/unicode/fsm/ \s+ // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static WHITESPACE_ANCHORED_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u16], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u16; 0], - bytes: B, - } +use regex_automata::{ + dfa::dense::DFA, + util::{lazy::Lazy, wire::AlignAs}, +}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("whitespace_anchored_rev.bigendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static WHITESPACE_ANCHORED_REV: ::once_cell::sync::Lazy< - ::regex_automata::DenseDFA<&'static [u16], u16>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u16; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("whitespace_anchored_rev.littleendian.dfa"), - }; - - unsafe { ::regex_automata::DenseDFA::from_bytes(&ALIGNED.bytes) } -}); +pub static WHITESPACE_ANCHORED_REV: Lazy<DFA<&'static [u32]>> = + Lazy::new(|| { + static ALIGNED: &AlignAs<[u8], u32> = &AlignAs { + _align: [], + #[cfg(target_endian = "big")] + bytes: *include_bytes!("whitespace_anchored_rev.bigendian.dfa"), + #[cfg(target_endian = "little")] + bytes: *include_bytes!("whitespace_anchored_rev.littleendian.dfa"), + }; + let (dfa, _) = DFA::from_bytes(&ALIGNED.bytes) + .expect("serialized DFA should be valid"); + dfa + }); diff --git a/vendor/bstr/src/unicode/fsm/word_break_fwd.bigendian.dfa b/vendor/bstr/src/unicode/fsm/word_break_fwd.bigendian.dfa Binary files differindex efb9c8198..6cca67ff6 100644 --- a/vendor/bstr/src/unicode/fsm/word_break_fwd.bigendian.dfa +++ b/vendor/bstr/src/unicode/fsm/word_break_fwd.bigendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/word_break_fwd.littleendian.dfa b/vendor/bstr/src/unicode/fsm/word_break_fwd.littleendian.dfa Binary files differindex 9a716d060..d8bfd0126 100644 --- a/vendor/bstr/src/unicode/fsm/word_break_fwd.littleendian.dfa +++ b/vendor/bstr/src/unicode/fsm/word_break_fwd.littleendian.dfa diff --git a/vendor/bstr/src/unicode/fsm/word_break_fwd.rs b/vendor/bstr/src/unicode/fsm/word_break_fwd.rs index dcb5f6bce..825782f1c 100644 --- a/vendor/bstr/src/unicode/fsm/word_break_fwd.rs +++ b/vendor/bstr/src/unicode/fsm/word_break_fwd.rs @@ -1,41 +1,19 @@ // DO NOT EDIT THIS FILE. IT WAS AUTOMATICALLY GENERATED BY: // -// ucd-generate dfa --name WORD_BREAK_FWD --sparse --minimize --anchored --state-size 4 src/unicode/fsm/ [snip (arg too long)] +// regex-cli generate serialize sparse dfa --minimize --start-kind anchored --shrink --rustfmt --safe WORD_BREAK_FWD src/unicode/fsm/ <snip: arg too long> // -// ucd-generate 0.2.12 is available on crates.io. +// regex-cli 0.0.1 is available on crates.io. -#[cfg(target_endian = "big")] -pub static WORD_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u32>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } +use regex_automata::{dfa::sparse::DFA, util::lazy::Lazy}; - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("word_break_fwd.bigendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } -}); - -#[cfg(target_endian = "little")] -pub static WORD_BREAK_FWD: ::once_cell::sync::Lazy< - ::regex_automata::SparseDFA<&'static [u8], u32>, -> = ::once_cell::sync::Lazy::new(|| { - #[repr(C)] - struct Aligned<B: ?Sized> { - _align: [u8; 0], - bytes: B, - } - - static ALIGNED: &'static Aligned<[u8]> = &Aligned { - _align: [], - bytes: *include_bytes!("word_break_fwd.littleendian.dfa"), - }; - - unsafe { ::regex_automata::SparseDFA::from_bytes(&ALIGNED.bytes) } +pub static WORD_BREAK_FWD: Lazy<DFA<&'static [u8]>> = Lazy::new(|| { + #[cfg(target_endian = "big")] + static BYTES: &'static [u8] = + include_bytes!("word_break_fwd.bigendian.dfa"); + #[cfg(target_endian = "little")] + static BYTES: &'static [u8] = + include_bytes!("word_break_fwd.littleendian.dfa"); + let (dfa, _) = + DFA::from_bytes(BYTES).expect("serialized DFA should be valid"); + dfa }); |