- $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:`
This commit is contained in:
Christoffer Lerno
2025-03-04 16:13:06 +01:00
parent 46b52ec9ce
commit 2439405e70
65 changed files with 149 additions and 149 deletions

View File

@@ -94,7 +94,7 @@ bitstruct UInt128LE : uint128 @littleendian
macro read(bytes, $Type)
{
char[] s;
$switch (@typekind(bytes))
$switch @typekind(bytes):
$case POINTER:
s = (*bytes)[:$Type.sizeof];
$default:
@@ -110,7 +110,7 @@ macro read(bytes, $Type)
macro write(x, bytes, $Type)
{
char[] s;
$switch (@typekind(bytes))
$switch @typekind(bytes):
$case POINTER:
s = (*bytes)[:$Type.sizeof];
$default:
@@ -121,7 +121,7 @@ macro write(x, bytes, $Type)
macro is_bitorder($Type)
{
$switch ($Type)
$switch $Type:
$case UShortLE:
$case ShortLE:
$case UIntLE:
@@ -146,7 +146,7 @@ macro is_bitorder($Type)
macro bool is_array_or_slice_of_char(bytes)
{
$switch (@typekind(bytes))
$switch @typekind(bytes):
$case POINTER:
var $Inner = $typefrom($typeof(bytes).inner);
$if $Inner.kindof == ARRAY:
@@ -164,7 +164,7 @@ macro bool is_array_or_slice_of_char(bytes)
macro bool is_arrayptr_or_slice_of_char(bytes)
{
$switch (@typekind(bytes))
$switch @typekind(bytes):
$case POINTER:
var $Inner = $typefrom($typeof(bytes).inner);
$if $Inner.kindof == ARRAY: