mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- `$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:`
23 lines
383 B
Plaintext
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;
|
|
}
|