[][src]Trait rslint_parser::ast::AstToken

pub trait AstToken {
    fn can_cast(token: SyntaxKind) -> bool
    where
        Self: Sized
;
fn cast(syntax: SyntaxToken) -> Option<Self>
    where
        Self: Sized
;
fn syntax(&self) -> &SyntaxToken; fn text(&self) -> &SmolStr { ... } }

Like AstNode, but wraps tokens rather than interior nodes.

Required methods

fn can_cast(token: SyntaxKind) -> bool where
    Self: Sized

fn cast(syntax: SyntaxToken) -> Option<Self> where
    Self: Sized

fn syntax(&self) -> &SyntaxToken

Loading content...

Provided methods

fn text(&self) -> &SmolStr

Loading content...

Implementors

impl AstToken for Comment[src]

impl AstToken for String[src]

impl AstToken for Whitespace[src]

Loading content...