Skip to main content

Module ast

Module ast 

Source

Re-exports§

pub use expr::Expr;
pub use expr::HasArgList;
pub use nodes::Arg;
pub use nodes::ArgList;
pub use nodes::AssignmentExpr;
pub use nodes::BinaryExpr;
pub use nodes::BlockExpr;
pub use nodes::CallExpr;
pub use nodes::ForExpr;
pub use nodes::ForExprParts;
pub use nodes::FunctionExpr;
pub use nodes::IfExpr;
pub use nodes::NamespaceAccess;
pub use nodes::Param;
pub use nodes::ParenExpr;
pub use nodes::RepeatExpr;
pub use nodes::Root;
pub use nodes::RoxygenBlock;
pub use nodes::RoxygenParagraph;
pub use nodes::RoxygenSection;
pub use nodes::RoxygenTag;
pub use nodes::Subset2Expr;
pub use nodes::SubsetExpr;
pub use nodes::UnaryExpr;
pub use nodes::WhileExpr;
pub use nodes::WhileExprParts;
pub use tokens::AstToken;
pub use tokens::Comment;
pub use tokens::ComplexLit;
pub use tokens::FloatLit;
pub use tokens::Ident;
pub use tokens::IntLit;
pub use tokens::RConstant;
pub use tokens::StringLit;
pub use tokens::token_name;

Modules§

expr
The Expr union over “any R expression”, and the HasArgList shared trait for the argument-bearing nodes.
kinds
Shared SyntaxKind predicates for the AST-wrapper layer and its consumers. Kept in one place so node/token accessors and the linter’s matchers agree on what counts as a binary operator, a unary operator, or trivia.
nodes
support
tokens
Typed AST wrappers over CST tokens (leaves), mirroring rowan’s AstNode for nodes. rowan 0.16 ships only AstNode; arity defines its own AstToken (as rust-analyzer does).

Structs§

AstChildren
AstPtr
Like SyntaxNodePtr, but remembers the type of node.
SyntaxNodePtr
A “pointer” to a SyntaxNode, via location in the source code.

Traits§

AstNode
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.