diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-29 21:36:25 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-29 21:36:25 +0100 |
| commit | 24d513d8917de0a8c23916837e5ea7fbb550db8b (patch) | |
| tree | a19a64099a96bab44a7a12f58b1515326925a695 /tests/typ/code/for.typ | |
| parent | 3cad6bf60785d899ecb78b557bf7ba3cd8903e56 (diff) | |
Enable for loop over captured args
Diffstat (limited to 'tests/typ/code/for.typ')
| -rw-r--r-- | tests/typ/code/for.typ | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/typ/code/for.typ b/tests/typ/code/for.typ index 2569f5a7..02bd0a27 100644 --- a/tests/typ/code/for.typ +++ b/tests/typ/code/for.typ @@ -32,6 +32,12 @@ // Should output `2345`. #for v in (1, 2, 3, 4, 5, 6, 7) [#if v >= 2 and v <= 5 { repr(v) }] +// Loop over captured arguments. +#let f1(..args) = for v in args { (repr(v),) } +#let f2(..args) = for k, v in args { (repr(k) + ": " + repr(v),) } +#let f(..args) = join(sep: ", ", ..f1(..args), ..f2(..args)) +#f(1, a: 2) + --- #let out = () |
