Make more precise range macro upmapping

This commit is contained in:
Lukas Wirth 2022-01-31 13:56:14 +01:00
parent 5fd3688018
commit 45ff51ba22
8 changed files with 81 additions and 81 deletions

View file

@ -187,10 +187,10 @@ macro_rules! match_ast {
(match $node:ident { $($tt:tt)* }) => { match_ast!(match ($node) { $($tt)* }) };
(match ($node:expr) {
$( ast::$ast:ident($it:pat) => $res:expr, )*
$( $( $path:ident )::+ ($it:pat) => $res:expr, )*
_ => $catch_all:expr $(,)?
}) => {{
$( if let Some($it) = ast::$ast::cast($node.clone()) { $res } else )*
$( if let Some($it) = $($path::)+cast($node.clone()) { $res } else )*
{ $catch_all }
}};
}