From 8c81c70b904a41b8a0d44dc418b7c39bf325c2a2 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 18 Aug 2022 09:34:17 +0200 Subject: macro bodyarg --- bootstrap/test.cff | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bootstrap/test.cff') diff --git a/bootstrap/test.cff b/bootstrap/test.cff index d835b7e..6f5242d 100644 --- a/bootstrap/test.cff +++ b/bootstrap/test.cff @@ -10,10 +10,10 @@ enum Color { Red, Green, Blue } -defmacro each(i, x, arr, ...body) [ +defmacro each(i, x, arr, &body) [ for let i = 0; i < arr.#len; ++i { let x = arr[i]; - { body } + body } ] @@ -88,9 +88,9 @@ extern fn main (argc int, argv **u8) int { let is []int = { [4] = 1, 2, [1 - 1] = 3 }; isort(is, is.#len); - each(i, x, is, + each(i, x, is) { printf("%d\n", x); - ) + } let slice [#]int = is[3::5]; printf("sl %d\n", slice[0]); -- cgit v1.2.3