mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Deprecate :; in $if etc.
This commit is contained in:
@@ -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, ...);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -95,7 +95,7 @@ fn int boo()
|
||||
}
|
||||
switch (eok)
|
||||
{
|
||||
case 1:
|
||||
case 1
|
||||
eok++;
|
||||
next;
|
||||
case 3:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user