diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-10-27 13:24:37 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-10-27 13:25:15 +0200 |
| commit | cbfd9884a94b55486f9b07296f23a01b34d080bd (patch) | |
| tree | fe6ea6d08b6977715c878158f5d2514efe7593cb /crates/typst-macros | |
| parent | fa81c3ece019b4667713d34cd5d7d23804045439 (diff) | |
Fix argument parsing bug
Things like `luma(1, key: "val")` didn't produce an error before because `args.finish()?` wasn't called. This changes `args: Args` to `args: &mut Args` to make it impossible for that to happen.
Diffstat (limited to 'crates/typst-macros')
| -rw-r--r-- | crates/typst-macros/src/func.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/typst-macros/src/func.rs b/crates/typst-macros/src/func.rs index 87d57f19..5b8501d0 100644 --- a/crates/typst-macros/src/func.rs +++ b/crates/typst-macros/src/func.rs @@ -317,7 +317,7 @@ fn create_wrapper_closure(func: &Func) -> TokenStream { .map(|tokens| quote! { #tokens, }); let vm_ = func.special.vm.then(|| quote! { vm, }); let vt_ = func.special.vt.then(|| quote! { &mut vm.vt, }); - let args_ = func.special.args.then(|| quote! { args.take(), }); + let args_ = func.special.args.then(|| quote! { args, }); let span_ = func.special.span.then(|| quote! { args.span, }); let forwarded = func.params.iter().filter(|param| !param.external).map(bind); quote! { |
