Files
c3c/test/test_suite/compile_time/concat_const.c3
Christoffer Lerno 2439405e70 - $foreach "()" replaced by trailing ":" $foreach ($x, $y : $foo) -> $foreach $x, $y : $foo:
- `$for` "()" replaced by trailing ":" `$for (var $x = 0; $x < FOO; $x++)` -> `$for var $x = 0; $x < FOO; $x++:`
- `$switch` "()" replaced by trailing ":" `$switch ($Type)` -> `$switch $Type:`
- Empty `$switch` requires trailing ":" `$switch` -> `$switch:`
2025-03-04 16:13:47 +01:00

23 lines
383 B
Plaintext

module wi3enrich;
import std::io;
import std::os::env;
macro String to_string(uint $num) @const
{
char[] $res;
int $i = 0;
$for ;$num != 0;:
$res = $res +++ (char) ('0' + $num % 10);
$num = $num / 10;
$i++;
$endfor
$res = $res +++ '\0';
return (String) $res;
}
fn int main(String[] args)
{
io::printn(to_string(4));
return 0;
}