Struct syntect::highlighting::ScopeSelectors [] [src]

pub struct ScopeSelectors {
    pub selectors: Vec<ScopeSelector>,
}

A selector set that matches anything matched by any of its component selectors. See The TextMate Docs for how these work.

Fields

the selectors, if any of them match, this matches

Methods

impl ScopeSelectors
[src]

checks if any of these selectors match the given scope stack if so it returns a match score, higher match scores are stronger matches. Scores are ordered according to the rules found at https://manual.macromates.com/en/scope_selectors

Examples

use syntect::parsing::{ScopeStack, MatchPower};
use syntect::highlighting::ScopeSelectors;
use std::str::FromStr;
assert_eq!(ScopeSelectors::from_str("a.b, a e.f - c k, e.f - a.b").unwrap()
    .does_match(ScopeStack::from_str("a.b c.d j e.f").unwrap().as_slice()),
    Some(MatchPower(0o2001u64 as f64)));

Trait Implementations

impl Debug for ScopeSelectors
[src]

Formats the value using the given formatter.

impl Clone for ScopeSelectors
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for ScopeSelectors
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for ScopeSelectors
[src]

impl Default for ScopeSelectors
[src]

Returns the "default value" for a type. Read more

impl FromStr for ScopeSelectors
[src]

The associated error which can be returned from parsing.

Parses a series of selectors separated by commas or pipes