Add raw! and embed! macros in luaify

This commit is contained in:
2025-06-19 17:02:53 +10:00
parent 16ab2be6f4
commit af81879b42
4 changed files with 97 additions and 47 deletions

View File

@@ -1,6 +1,6 @@
use std::mem;
use crate::utils::{LuaType, syn_error, unwrap_expr_ident, unwrap_pat_ident, wrap_expr_block};
use quote::format_ident;
use std::mem;
use syn::{spanned::*, visit_mut::*, *};
pub fn transform(expr: &mut Expr) -> Result<()> {
@@ -158,7 +158,7 @@ impl Visitor {
}
};
let tmp = Ident::new(&format!("_{ident}"), ident.span());
let tmp = format_ident!("_{ident}");
let span = cast.span();
*expr = match ty {
LuaType::Any => parse_quote_spanned!(span => {}),