mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +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:`
36 lines
577 B
Plaintext
36 lines
577 B
Plaintext
|
|
fn void test()
|
|
{
|
|
$switch 3:
|
|
$case 2:
|
|
return;
|
|
$default: // #error: $default must be last in a $switch
|
|
$default:
|
|
return;
|
|
$endswitch
|
|
}
|
|
|
|
fn void test1()
|
|
{
|
|
$switch 1:
|
|
$case -1:
|
|
return;
|
|
$case -1: // #error: '-1' appears more than once
|
|
return;
|
|
$default:
|
|
return;
|
|
$endswitch
|
|
}
|
|
|
|
|
|
fn void test3()
|
|
{
|
|
$switch 3:
|
|
$case 3:
|
|
return;
|
|
$case 123.0: // #error: 'int'
|
|
return;
|
|
$default:
|
|
return;
|
|
$endswitch
|
|
} |