Commit 4375acda authored by Ramla-I's avatar Ramla-I

Update src/compile.rs

parent 58bbf033
Pipeline #6342 failed with stage
in 38 seconds
......@@ -129,26 +129,26 @@ impl<'a> PosixRegexBuilder<'a> {
self.classes.insert(name, callback);
self
}
/// Add all the default collation classes, like `[[:digit:]]` and `[[:alnum:]]`
pub fn with_default_classes(mut self) -> Self {
#[cfg(not(feature = "no_std"))]
self.classes.reserve(12);
// /// Add all the default collation classes, like `[[:digit:]]` and `[[:alnum:]]`
// pub fn with_default_classes(mut self) -> Self {
// #[cfg(not(feature = "no_std"))]
// self.classes.reserve(12);
self.classes.insert(b"alnum", ctype::is_alnum);
self.classes.insert(b"alpha", ctype::is_alpha);
self.classes.insert(b"blank", ctype::is_blank);
self.classes.insert(b"cntrl", ctype::is_cntrl);
self.classes.insert(b"digit", ctype::is_digit);
self.classes.insert(b"graph", ctype::is_graph);
self.classes.insert(b"lower", ctype::is_lower);
self.classes.insert(b"print", ctype::is_print);
self.classes.insert(b"punct", ctype::is_punct);
self.classes.insert(b"space", ctype::is_space);
self.classes.insert(b"upper", ctype::is_upper);
self.classes.insert(b"xdigit", ctype::is_xdigit);
// self.classes.insert(b"alnum", ctype::is_alnum);
// self.classes.insert(b"alpha", ctype::is_alpha);
// self.classes.insert(b"blank", ctype::is_blank);
// self.classes.insert(b"cntrl", ctype::is_cntrl);
// self.classes.insert(b"digit", ctype::is_digit);
// self.classes.insert(b"graph", ctype::is_graph);
// self.classes.insert(b"lower", ctype::is_lower);
// self.classes.insert(b"print", ctype::is_print);
// self.classes.insert(b"punct", ctype::is_punct);
// self.classes.insert(b"space", ctype::is_space);
// self.classes.insert(b"upper", ctype::is_upper);
// self.classes.insert(b"xdigit", ctype::is_xdigit);
self
}
// self
// }
/// "Compile" this regex to a struct ready to match input
pub fn compile(self) -> Result<PosixRegex<'static>, Error> {
let tree = self.compile_tokens()?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment