Chih-Hung Hsieh | e42c505 | 2020-04-16 10:44:21 -0700 | [diff] [blame] | 1 | #![cfg_attr(feature = "pattern", feature(pattern))] |
| 2 | |
| 3 | extern crate rand; |
| 4 | extern crate regex; |
| 5 | |
| 6 | macro_rules! regex_new { |
| 7 | ($re:expr) => {{ |
| 8 | use regex::internal::ExecBuilder; |
| 9 | ExecBuilder::new($re) |
| 10 | .bounded_backtracking() |
| 11 | .build() |
| 12 | .map(|e| e.into_regex()) |
| 13 | }}; |
| 14 | } |
| 15 | |
| 16 | macro_rules! regex { |
| 17 | ($re:expr) => { |
| 18 | regex_new!($re).unwrap() |
| 19 | }; |
| 20 | } |
| 21 | |
| 22 | macro_rules! regex_set_new { |
| 23 | ($re:expr) => {{ |
| 24 | use regex::internal::ExecBuilder; |
| 25 | ExecBuilder::new_many($re) |
| 26 | .bounded_backtracking() |
| 27 | .build() |
| 28 | .map(|e| e.into_regex_set()) |
| 29 | }}; |
| 30 | } |
| 31 | |
| 32 | macro_rules! regex_set { |
| 33 | ($res:expr) => { |
| 34 | regex_set_new!($res).unwrap() |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | // Must come before other module definitions. |
| 39 | include!("macros_str.rs"); |
| 40 | include!("macros.rs"); |
| 41 | |
| 42 | mod api; |
| 43 | mod api_str; |
| 44 | mod crazy; |
| 45 | mod flags; |
| 46 | mod fowler; |
| 47 | mod multiline; |
| 48 | mod noparse; |
| 49 | mod regression; |
| 50 | mod replace; |
| 51 | mod searcher; |
| 52 | mod set; |
| 53 | mod suffix_reverse; |
| 54 | #[cfg(feature = "unicode")] |
| 55 | mod unicode; |
| 56 | #[cfg(feature = "unicode-perl")] |
| 57 | mod word_boundary; |
| 58 | #[cfg(feature = "unicode-perl")] |
| 59 | mod word_boundary_unicode; |