Trait rslint_parser::ast::AstNode [−][src]
pub trait AstNode {
fn can_cast(kind: SyntaxKind) -> bool
where
Self: Sized;
fn cast(syntax: SyntaxNode) -> Option<Self>
where
Self: Sized;
fn syntax(&self) -> &SyntaxNode;
fn text(&self) -> String { ... }
fn range(&self) -> TextRange { ... }
}
Expand description
The main trait to go from untyped SyntaxNode
to a typed ast. The
conversion itself has zero runtime cost: ast and syntax nodes have exactly
the same representation: a pointer to the tree root and a pointer to the
node itself.