mirror of
https://gitee.com/openharmony/third_party_rust_regex
synced 2025-04-12 15:43:16 +00:00
Update old documentation for #172.
This commit is contained in:
parent
4466bb7b98
commit
640bfa762d
@ -194,12 +194,9 @@ pub enum Repeater {
|
|||||||
/// sequence of non-overlapping ranges. This makes it possible to test whether
|
/// sequence of non-overlapping ranges. This makes it possible to test whether
|
||||||
/// a character is matched by a class with a binary search.
|
/// a character is matched by a class with a binary search.
|
||||||
///
|
///
|
||||||
/// Additionally, a character class may be marked *case insensitive*. If it's
|
/// If the case insensitive flag was set when parsing a character class, then
|
||||||
/// case insensitive, then:
|
/// simple case folding is done automatically. For example, `(?i)[a-c]` is
|
||||||
///
|
/// automatically translated to `[a-cA-C]`.
|
||||||
/// 1. Simple case folding has been applied to all ranges.
|
|
||||||
/// 2. Simple case folding must be applied to a character before testing
|
|
||||||
/// whether it matches the character class.
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct CharClass {
|
pub struct CharClass {
|
||||||
ranges: Vec<ClassRange>,
|
ranges: Vec<ClassRange>,
|
||||||
@ -375,8 +372,6 @@ impl CharClass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new empty class from this one.
|
/// Create a new empty class from this one.
|
||||||
///
|
|
||||||
/// Namely, its capacity and case insensitive setting will be the same.
|
|
||||||
fn to_empty(&self) -> CharClass {
|
fn to_empty(&self) -> CharClass {
|
||||||
CharClass { ranges: Vec::with_capacity(self.len()) }
|
CharClass { ranges: Vec::with_capacity(self.len()) }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user