Struct syntect::parsing::syntax_definition::MatchPattern
[−]
[src]
pub struct MatchPattern { pub has_captures: bool, pub regex_str: String, pub regex: Option<Regex>, pub scope: Vec<Scope>, pub captures: Option<CaptureMapping>, pub operation: MatchOperation, pub with_prototype: Option<ContextPtr>, }
Fields
has_captures: bool
regex_str: String
regex: Option<Regex>
scope: Vec<Scope>
captures: Option<CaptureMapping>
operation: MatchOperation
with_prototype: Option<ContextPtr>
Methods
impl MatchPattern
[src]
fn regex_with_substitutes(&self, region: &Region, s: &str) -> String
substitutes back-refs in Regex with regions from s used for match patterns which refer to captures from the pattern that pushed them.
fn compile_with_refs(&self, region: &Region, s: &str) -> Regex
Used by the parser to compile a regex which needs to reference regions from another matched pattern.
fn ensure_compiled_if_possible(&mut self)
Makes sure the regex is compiled if it doesn't have captures. May compile the regex if it isn't, panicing if compilation fails.
Trait Implementations
impl Debug for MatchPattern
[src]
impl Eq for MatchPattern
[src]
impl PartialEq for MatchPattern
[src]
fn eq(&self, __arg_0: &MatchPattern) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MatchPattern) -> bool
This method tests for !=
.