Document match_ast!

This commit is contained in:
kjeremy 2019-10-30 14:38:45 -04:00
parent eee55d4663
commit 7ad55e976c

View file

@ -160,6 +160,20 @@ impl SourceFile {
}
}
/// Matches a `SyntaxNode` against an `ast` type.
///
/// # Example:
///
/// ```ignore
/// match_ast! {
/// match node {
/// ast::CallExpr(it) => { ... },
/// ast::MethodCallExpr(it) => { ... },
/// ast::MacroCall(it) => { ... },
/// _ => None,
/// }
/// }
/// ```
#[macro_export]
macro_rules! match_ast {
(match $node:ident {