[][src]Macro rslint_parser::match_ast

macro_rules! match_ast {
    (match $node:ident { $($tt:tt)* }) => { ... };
    (match ($node:expr) {
        $( ast::$ast:ident($it:ident) => $res:expr, )*
        _ => $catch_all:expr $(,)?
    }) => { ... };
}

Matches a SyntaxNode against an ast type.

Example:

This example is not tested
match_ast! {
    match node {
        ast::CallExpr(it) => { ... },
        ast::BlockStmt(it) => { ... },
        ast::Script(it) => { ... },
        _ => None,
    }
}