From a65e73609657c7031aa2cd390428ef0dde515356 Mon Sep 17 00:00:00 2001 From: x86y Date: Mon, 2 Oct 2023 15:47:40 +0400 Subject: [PATCH] little fixes --- pkg/libfranca_bg.wasm | Bin 1153303 -> 1153334 bytes src/bin/main.rs | 2 +- src/lib/loops.rs | 5 +++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/libfranca_bg.wasm b/pkg/libfranca_bg.wasm index a252b7050c23d79068a46ade0e4ae3102690be7e..a625bd794edd1e4b9faae7e113a8ccc901015095 100644 GIT binary patch delta 450 zcmYk0u}cFn6vmU><>hKyn^P;Tf~F^8ON(?6tAj(J79B*zg8mIhUEQP=g$^!mnFMDC zkq*|;RkRNF76&&62S*3Np}te0CH%to-pkAPnO5bdRk_{~^y|1PnpHs&hFFM=@OD+e z;sfoO(`R_IQ+`I6S{J5QxV#6&^<(3XXeO^v%N{6O-!k80;Y=tdyBx2EP?0P>Nv#tfFE{$Zx7F#q>LsAI^lP85SFf zDr+^K#FZ5OhkjvKfqn|}&@d15^ZaHN=z@88KM%(|W-EZH1ZZ^BMc;G6G++(`m>lKG z`7`GK#xd7yzkt{51b_&{K_bWy5=CN292rIu?M@)q%E>uG$UKrK5)UC+q+sZQJ8$;V iZhAS7_3XgBfO-ZgZ?13b4)iZjFAUV@?aQ>gU;hF6NNQyO delta 339 zcmYk#yGjE=6b9g#+1)dnXmkcI$&zMvAsS5Z0%Gle<^|lRShTXSGop~f2RMx&0c(*I zuBB;&pjhZMHe!*&%F0eePe>Dnub4Cc{O7jU!d~lUPx80ZRCZFyi69>FNsy-!wjTKh zp1;7brn0(V_LEy*eaYDKw~e=3S~R|`WQkA%Fv32y@z+5`7V6@Rn*bkPA)XhOQD{9& zr23|iI*|sjOR-R@A8tI#RUJglfI2LXg$e9)`<_{@uE7NA59s%u$PyUs7&im%JBV@k z4rRP@FjoWJi$g(b$=Drqo9hp}bS#Eq(6!=p%7 b^a|Z;6YmY|M!KvoX|y>pzQ_lWJ~;jdcI{gg diff --git a/src/bin/main.rs b/src/bin/main.rs index 500199b..0618918 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -3,6 +3,6 @@ use libfranca::loops::mkterse; fn main() { - let i = mkterse("fn a() { let a = 5; let mut b = 10; }".into()); + let i = mkterse("fn a() { let a = &mut 5; let mut b = 10; }".into()); println!("{i}"); } diff --git a/src/lib/loops.rs b/src/lib/loops.rs index 815455a..d94e678 100644 --- a/src/lib/loops.rs +++ b/src/lib/loops.rs @@ -25,10 +25,11 @@ fn transform_stmt(stmt: &Stmt) -> Vec { let init = init.as_ref().unwrap(); let expr = &init.expr; if let syn::Pat::Ident(ident) = pat { + let var_ident = &ident.ident; if ident.mutability.is_some() { - return vec![parse_quote! { lm!(#expr); }]; + return vec![parse_quote! { lm!(#var_ident, #expr); }]; } else { - return vec![parse_quote! { l!(#expr); }]; + return vec![parse_quote! { l!(#var_ident, #expr); }]; } } }