Deprecate :; in $if etc.

This commit is contained in:
Christoffer Lerno
2023-03-20 01:03:54 +01:00
parent cc87c77af3
commit 5ee0d52ff1
94 changed files with 680 additions and 655 deletions

View File

@@ -1,10 +1,10 @@
macro int factorial($n)
{
$if ($n == 0):
$if ($n == 0)
return 1;
$else:
$else
return $n * factorial($n - 1);
$endif;
$endif
}
extern fn void printf(char *fmt, ...);

View File

@@ -16,7 +16,7 @@ const uint MaxDepth = 8;
//#define DEBUG_NODES
$if (DEBUG_NODES):
$if (DEBUG_NODES)
fn void Blocks.dump(Blocks* b)
{
@@ -77,7 +77,7 @@ fn void Blocks.dump(Blocks* b)
}
}
$endif;
$endif
/**
* @ensure const(a), const(b)
@@ -436,7 +436,7 @@ fn const Node* Reader.findNode(const Reader* r, const char* key)
Node* node = nil;
while (1) {
switch (*cp) {
case 0:
case 0
len = cast<u32>(cp - start);
mem::copy(name, start, len);
name[len] = 0;

View File

@@ -95,7 +95,7 @@ fn int boo()
}
switch (eok)
{
case 1:
case 1
eok++;
next;
case 3:

View File

@@ -143,9 +143,9 @@ $else
generic boofer2(i, g, eok)
{
case int, String, type($eoo):
case int, String, type($eoo)
return "Helo";
default:
default
return 1000;
}

View File

@@ -1,14 +1,14 @@
module hello_world;
import std;
import bar;
$if (env::OS_TYPE == OsType.WIN32):
$if (env::OS_TYPE == OsType.WIN32)
fn int test_doubler(int x)
{
return x * x;
}
$else:
$else
extern fn int test_doubler(int);
$endif;
$endif
extern fn void printf(char *, ...);
fn int main()