- Introduce $vaarg[...] syntax and deprecate the old $vaarg(...).

- Similar change to `$vasplat`: `$vasplat` and `$vasplat[1..]`.
This commit is contained in:
Christoffer Lerno
2024-08-16 09:28:28 +02:00
parent 9fd9280132
commit edfea639cf
20 changed files with 119 additions and 74 deletions

View File

@@ -5,7 +5,7 @@ import std::io;
macro test(start, ...)
{
$for (var $i = 0; $i < $vacount; $i++)
for ($vatype($i) i = ($vatype($i))start; i < 5; i+=2)
for ($vatype[$i] i = ($vatype[$i])start; i < 5; i+=2)
{
assert(math::is_even(i));
assert(i.is_even());