Struct syntect::parsing::syntax_definition::SyntaxDefinition [−][src]
pub struct SyntaxDefinition { pub name: String, pub file_extensions: Vec<String>, pub scope: Scope, pub first_line_match: Option<String>, pub hidden: bool, pub variables: HashMap<String, String>, pub contexts: HashMap<String, Context>, }
The main data structure representing a syntax definition loaded from a
.sublime-syntax
file. You'll probably only need these as references
to be passed around to parsing code.
Some useful public fields are the name
field which is a human readable
name to display in syntax lists, and the hidden
field which means hide
this syntax from any lists because it is for internal use.
Fields
name: String
file_extensions: Vec<String>
scope: Scope
first_line_match: Option<String>
variables: HashMap<String, String>
contexts: HashMap<String, Context>
Methods
impl SyntaxDefinition
[src]
impl SyntaxDefinition
pub fn load_from_str(
s: &str,
lines_include_newline: bool,
fallback_name: Option<&str>
) -> Result<SyntaxDefinition, ParseSyntaxError>
[src]
pub fn load_from_str(
s: &str,
lines_include_newline: bool,
fallback_name: Option<&str>
) -> Result<SyntaxDefinition, ParseSyntaxError>
In case you want to create your own SyntaxDefinition's in memory from strings.
Generally you should use a SyntaxSet
fallback_name
is an optional name to use when the YAML doesn't provide a name
key.
Trait Implementations
impl Clone for SyntaxDefinition
[src]
impl Clone for SyntaxDefinition
fn clone(&self) -> SyntaxDefinition
[src]
fn clone(&self) -> SyntaxDefinition
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for SyntaxDefinition
[src]
impl Debug for SyntaxDefinition
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Eq for SyntaxDefinition
[src]
impl Eq for SyntaxDefinition
impl PartialEq for SyntaxDefinition
[src]
impl PartialEq for SyntaxDefinition
fn eq(&self, other: &SyntaxDefinition) -> bool
[src]
fn eq(&self, other: &SyntaxDefinition) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &SyntaxDefinition) -> bool
[src]
fn ne(&self, other: &SyntaxDefinition) -> bool
This method tests for !=
.
Auto Trait Implementations
impl Send for SyntaxDefinition
impl Send for SyntaxDefinition
impl Sync for SyntaxDefinition
impl Sync for SyntaxDefinition