Struct syntect::parsing::syntax_definition::MatchPattern
source · pub struct MatchPattern {
pub has_captures: bool,
pub regex: Regex,
pub scope: Vec<Scope>,
pub captures: Option<CaptureMapping>,
pub operation: MatchOperation,
pub with_prototype: Option<ContextReference>,
}
Fields§
§has_captures: bool
§regex: Regex
§scope: Vec<Scope>
§captures: Option<CaptureMapping>
§operation: MatchOperation
§with_prototype: Option<ContextReference>
Implementations§
source§impl MatchPattern
impl MatchPattern
pub fn new( has_captures: bool, regex_str: String, scope: Vec<Scope>, captures: Option<CaptureMapping>, operation: MatchOperation, with_prototype: Option<ContextReference> ) -> MatchPattern
sourcepub fn regex_with_refs(&self, region: &Region, text: &str) -> Regex
pub fn regex_with_refs(&self, region: &Region, text: &str) -> Regex
Used by the parser to compile a regex which needs to reference regions from another matched pattern.
pub fn regex(&self) -> &Regex
Trait Implementations§
source§impl Clone for MatchPattern
impl Clone for MatchPattern
source§fn clone(&self) -> MatchPattern
fn clone(&self) -> MatchPattern
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MatchPattern
impl Debug for MatchPattern
source§impl<'de> Deserialize<'de> for MatchPattern
impl<'de> Deserialize<'de> for MatchPattern
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<MatchPattern> for MatchPattern
impl PartialEq<MatchPattern> for MatchPattern
source§fn eq(&self, other: &MatchPattern) -> bool
fn eq(&self, other: &MatchPattern) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for MatchPattern
impl Serialize for MatchPattern
impl Eq for MatchPattern
impl StructuralEq for MatchPattern
impl StructuralPartialEq for MatchPattern
Auto Trait Implementations§
impl RefUnwindSafe for MatchPattern
impl Send for MatchPattern
impl Sync for MatchPattern
impl Unpin for MatchPattern
impl UnwindSafe for MatchPattern
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.