pub struct Context {
pub meta_scope: Vec<Scope>,
pub meta_content_scope: Vec<Scope>,
pub meta_include_prototype: Option<bool>,
pub clear_scopes: Option<ClearAmount>,
pub prototype: Option<ContextId>,
pub uses_backrefs: bool,
pub patterns: Vec<Pattern>,
/* private fields */
}Fields§
§meta_scope: Vec<Scope>§meta_content_scope: Vec<Scope>§meta_include_prototype: Option<bool>Whether this context includes its syntax’s prototype. Some(bool) carries the value
set by the YAML (or inherited from a parent on an extends: / meta_append /
meta_prepend merge). None means the field was never set explicitly and callers
should treat it as true (Sublime’s default — use .unwrap_or(true) at consumption
points). Tracking unset separately lets an extends merge inherit the parent’s
value when the child doesn’t restate it — the case that was miscompiling TSQL’s
inside-like-single-quoted-string meta_append against the SQL base that sets
meta_include_prototype: false.
clear_scopes: Option<ClearAmount>§prototype: Option<ContextId>This is filled in by the linker at link time
for contexts that have meta_include_prototype==true
and are not included from the prototype.
uses_backrefs: bool§patterns: Vec<Pattern>Implementations§
Source§impl Context
impl Context
Sourcepub fn match_at(&self, index: usize) -> Result<&MatchPattern, ParsingError>
pub fn match_at(&self, index: usize) -> Result<&MatchPattern, ParsingError>
Returns the match pattern at an index
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Context
impl<'de> Deserialize<'de> for Context
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>,
impl Eq for Context
impl StructuralPartialEq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.