desugars operator overloading
add cast
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/lib.rs | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -1,6 +1,6 @@ [package] name = "lower-macros" -version = "0.2.8" +version = "0.2.9" authors = ["bend-n <[email protected]>"] description = "desugar math where the compiler wont" edition = "2021" @@ -355,6 +355,12 @@ fn walk(sub: &impl Sub, e: Expr) -> TokenStream { quote! { #label: #b } } Expr::Block(ExprBlock { block, .. }) => map_block(block), + Expr::Cast(ExprCast { + expr, as_token, ty, .. + }) => { + let e = walk(*expr); + quote! { #e #as_token #ty } + } e => quote!(#e), } } |