Macro ra_ap_syntax::match_ast [−][src]
macro_rules! match_ast { (match $node : ident { $($tt : tt) * }) => { ... }; (match($node : expr) { $(ast :: $ast : ident($it : ident) => $res : expr,) * _ => $catch_all : expr $(,) ? }) => { ... }; }
Expand description
Matches a SyntaxNode
against an ast
type.
Example:
ⓘ
match_ast! { match node { ast::CallExpr(it) => { ... }, ast::MethodCallExpr(it) => { ... }, ast::MacroCall(it) => { ... }, _ => None, } }