pub struct MatchPattern {Show 15 fields
pub regex: String,
pub scope: Option<String>,
pub captures: HashMap<u32, CaptureSpec>,
pub push: Option<ContextReference>,
pub pop: Option<PopAction>,
pub set: Option<ContextReference>,
pub embed: Option<String>,
pub embed_scope: Option<String>,
pub escape: Option<String>,
pub escape_captures: HashMap<u32, CaptureSpec>,
pub with_prototype: Option<Vec<RawContextPattern>>,
pub branch: Option<Vec<String>>,
pub branch_point: Option<String>,
pub fail: Option<String>,
pub comment: Option<String>,
}Expand description
A match: pattern entry.
Fields§
§regex: StringThe regex source string.
scope: Option<String>Optional scope to apply to the matched text.
captures: HashMap<u32, CaptureSpec>Per-capture scope specifications.
push: Option<ContextReference>Push contexts when the pattern matches.
pop: Option<PopAction>Pop contexts when the pattern matches.
set: Option<ContextReference>Set/replace contexts when the pattern matches.
embed: Option<String>Embed another syntax reference.
embed_scope: Option<String>Scope applied to embedded content.
escape: Option<String>Escape regex used to terminate an embed.
escape_captures: HashMap<u32, CaptureSpec>Capture specs applied to the escape match.
with_prototype: Option<Vec<RawContextPattern>>Prototype patterns to apply for this match.
branch: Option<Vec<String>>Branch target context names (advanced Sublime feature).
branch_point: Option<String>Branch point name (advanced Sublime feature).
fail: Option<String>Fail target (advanced Sublime feature).
comment: Option<String>Optional comment (ignored by the engine).
Trait Implementations§
Source§impl Clone for MatchPattern
impl Clone for MatchPattern
Source§fn clone(&self) -> MatchPattern
fn clone(&self) -> MatchPattern
Returns a duplicate 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
Auto Trait Implementations§
impl Freeze for MatchPattern
impl RefUnwindSafe for MatchPattern
impl Send for MatchPattern
impl Sync for MatchPattern
impl Unpin for MatchPattern
impl UnsafeUnpin for MatchPattern
impl UnwindSafe for MatchPattern
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