struct Chk<'a> {
c: Vec<char>,
i: usize,
u: bool,
v: bool,
has_names: bool,
total_groups: usize,
all_names: Vec<String>,
_p: PhantomData<&'a ()>,
}Fields§
§c: Vec<char>§i: usize§u: boolu または v フラグ(Unicode モード)。
v: boolv フラグ(unicodeSets)。
has_names: bool名前つきの捕捉グループが 1 つでもあるか(\k を名前参照として扱うか)。
total_groups: usize捕捉グループの総数。
all_names: Vec<String>パターン中の全グループ名(前方参照の検査用)。
_p: PhantomData<&'a ()>i 以外の修飾子の検査のための入れ子の深さ。
Implementations§
Source§impl<'a> Chk<'a>
impl<'a> Chk<'a>
fn peek(&self) -> Option<char>
fn peek_at(&self, n: usize) -> Option<char>
fn eat(&mut self, ch: char) -> bool
fn starts(&self, s: &str) -> bool
Sourcefn disjunction(
&mut self,
outer: &mut Vec<String>,
depth: usize,
) -> Result<(), String>
fn disjunction( &mut self, outer: &mut Vec<String>, depth: usize, ) -> Result<(), String>
outer: 外側ですでに宣言された名前(同じ経路に並ぶ重複の検査)。宣言した名前を足して返す。
fn alternative( &mut self, outer: &mut Vec<String>, depth: usize, ) -> Result<(), String>
fn term(&mut self, outer: &mut Vec<String>, depth: usize) -> Result<(), String>
Sourcefn brace_quantifier(&self) -> Result<Option<usize>, String>
fn brace_quantifier(&self) -> Result<Option<usize>, String>
{n} {n,} {n,m} なら末尾の次の位置(} の後)を返す。形でなければ None。n > m は誤り。
fn group(&mut self, outer: &mut Vec<String>, depth: usize) -> Result<(), String>
Sourcefn group_name(&mut self) -> Result<String, String>
fn group_name(&mut self) -> Result<String, String>
< の直後から > までのグループ名を読む(エスケープ可)。
Sourcefn unicode_escape_body(&mut self, force_u: bool) -> Result<Option<u32>, String>
fn unicode_escape_body(&mut self, force_u: bool) -> Result<Option<u32>, String>
\u の後ろ。{…}(force_u か Unicode モードのとき)・4 桁・サロゲートの対。
形が合えば Some(コードポイント)、合わなければ None(位置は戻す)。
fn atom_escape(&mut self) -> Result<(), String>
fn legacy_octal(&mut self)
Sourcefn char_or_class_escape(&mut self, in_class: bool) -> Result<(), String>
fn char_or_class_escape(&mut self, in_class: bool) -> Result<(), String>
\ の次の位置から、CharacterClassEscape / CharacterEscape を読む。
クラスの中では -(Unicode モード)と b も許す。クラス文字を返す代わりに「単独の文字か」を
last_single に残す(範囲の検査用)。
Sourcefn escape_single(&mut self, in_class: bool) -> Result<Option<u32>, String>
fn escape_single(&mut self, in_class: bool) -> Result<Option<u32>, String>
読んだ escape が 1 文字を表すならそのコードポイント、クラスの略記(\d など)なら None。
Sourcefn property_escape(&mut self, negated: bool) -> Result<bool, String>
fn property_escape(&mut self, negated: bool) -> Result<bool, String>
\p{…} \P{…}(p の次の位置から)。ECMA-262 Table 66〜69 に従いプロパティ名・値を検証する。
返り値は文字列の性質(v フラグでだけ許される)か。
fn class(&mut self) -> Result<(), String>
Sourcefn class_set_body(&mut self) -> Result<bool, String>
fn class_set_body(&mut self) -> Result<bool, String>
v フラグのクラス本体([ と ^ の後ろから ] まで)。文字列を含みうるか。
Sourcefn class_set_operand(&mut self) -> Result<(bool, Option<u32>), String>
fn class_set_operand(&mut self) -> Result<(bool, Option<u32>), String>
ClassSetOperand 1 つ。返り値: (文字列を含みうるか, 単独の文字ならそのコードポイント)。
fn class_set_character(&mut self) -> Result<u32, String>
Auto Trait Implementations§
impl<'a> Freeze for Chk<'a>
impl<'a> RefUnwindSafe for Chk<'a>
impl<'a> Send for Chk<'a>
impl<'a> Sync for Chk<'a>
impl<'a> Unpin for Chk<'a>
impl<'a> UnsafeUnpin for Chk<'a>
impl<'a> UnwindSafe for Chk<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more