sqruff_lib_core::parser::matchable

Trait MatchableTrait

Source
pub trait MatchableTrait {
    // Required method
    fn elements(&self) -> &[Matchable];

    // Provided methods
    fn get_type(&self) -> SyntaxKind { ... }
    fn match_grammar(&self) -> Option<Matchable> { ... }
    fn is_optional(&self) -> bool { ... }
    fn simple(
        &self,
        parse_context: &ParseContext<'_>,
        crumbs: Option<Vec<&str>>,
    ) -> Option<(AHashSet<String>, SyntaxSet)> { ... }
    fn match_segments(
        &self,
        _segments: &[ErasedSegment],
        _idx: u32,
        _parse_context: &mut ParseContext<'_>,
    ) -> Result<MatchResult, SQLParseError> { ... }
    fn cache_key(&self) -> MatchableCacheKey { ... }
    fn copy(
        &self,
        _insert: Option<Vec<Matchable>>,
        _at: Option<usize>,
        _before: Option<Matchable>,
        _remove: Option<Vec<Matchable>>,
        _terminators: Vec<Matchable>,
        _replace_terminators: bool,
    ) -> Matchable { ... }
}

Required Methods§

Source

fn elements(&self) -> &[Matchable]

Provided Methods§

Source

fn get_type(&self) -> SyntaxKind

Source

fn match_grammar(&self) -> Option<Matchable>

Source

fn is_optional(&self) -> bool

Source

fn simple( &self, parse_context: &ParseContext<'_>, crumbs: Option<Vec<&str>>, ) -> Option<(AHashSet<String>, SyntaxSet)>

Source

fn match_segments( &self, _segments: &[ErasedSegment], _idx: u32, _parse_context: &mut ParseContext<'_>, ) -> Result<MatchResult, SQLParseError>

Source

fn cache_key(&self) -> MatchableCacheKey

Source

fn copy( &self, _insert: Option<Vec<Matchable>>, _at: Option<usize>, _before: Option<Matchable>, _remove: Option<Vec<Matchable>>, _terminators: Vec<Matchable>, _replace_terminators: bool, ) -> Matchable

Implementors§