mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Updated TODO
This commit is contained in:
committed by
Christoffer Lerno
parent
eabef8f468
commit
9bf89574f9
@@ -47,16 +47,15 @@ Things missing:
|
|||||||
- Disallow x >= 0 and x < 0 on unsigned types unless in a macro.
|
- Disallow x >= 0 and x < 0 on unsigned types unless in a macro.
|
||||||
- Range check arrays on debug
|
- Range check arrays on debug
|
||||||
- Allow negating int if assigned to a larger type. E.g short x = 1; int y = -x;
|
- Allow negating int if assigned to a larger type. E.g short x = 1; int y = -x;
|
||||||
|
- Expression block does not handle defer correctly.
|
||||||
|
|
||||||
* Switch
|
* Switch
|
||||||
- String switch
|
- String switch
|
||||||
- Range case
|
- Range case
|
||||||
|
|
||||||
* Functions
|
* Functions
|
||||||
- Varargs
|
|
||||||
- C ABI
|
- C ABI
|
||||||
- Safe varargs
|
- Safe varargs
|
||||||
- Named parameters
|
|
||||||
|
|
||||||
* Pre-post conditions
|
* Pre-post conditions
|
||||||
- Breakdown here
|
- Breakdown here
|
||||||
|
|||||||
@@ -517,11 +517,52 @@ func void testDefault(int x = 2, int y = 100, int z = -100)
|
|||||||
{
|
{
|
||||||
printf("x = %d, y = %d, z = %d\n", x, y, z);
|
printf("x = %d, y = %d, z = %d\n", x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func int testReturnDefer()
|
||||||
|
{
|
||||||
|
int i = 0;
|
||||||
|
i++;
|
||||||
|
defer ++i;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
func void testDefer()
|
||||||
|
{
|
||||||
|
printf("1 == %d\n", testReturnDefer());
|
||||||
|
printf("1");
|
||||||
|
defer printf("8\n");
|
||||||
|
printf("2");
|
||||||
|
{
|
||||||
|
printf("3");
|
||||||
|
defer printf("5");
|
||||||
|
printf("4");
|
||||||
|
}
|
||||||
|
int i = 0;
|
||||||
|
goto JUMP;
|
||||||
|
defer printf("ERROR");
|
||||||
|
int r = 0;
|
||||||
|
JUMP:
|
||||||
|
defer printf("-JUMPDEFER-");
|
||||||
|
if (i++ < 2) goto JUMP;
|
||||||
|
switch (int boo = 2)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
printf("\n0\n");
|
||||||
|
case 2:
|
||||||
|
defer printf("*CaseDefer*");
|
||||||
|
printf("-Case2-");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
defer printf("7");
|
||||||
|
printf("6");
|
||||||
|
}
|
||||||
func int main(int x)
|
func int main(int x)
|
||||||
{
|
{
|
||||||
printf("Helo!\n");
|
printf("Helo!\n");
|
||||||
testDefault(y = 99);
|
testDefault(y = 99);
|
||||||
testPointers(2, 3);
|
testPointers(2, 3);
|
||||||
|
testDefer();
|
||||||
int efd = 9;
|
int efd = 9;
|
||||||
uint fefoek = 1;
|
uint fefoek = 1;
|
||||||
printf("Helo: %d\n", efd + cast(fefoek, int));
|
printf("Helo: %d\n", efd + cast(fefoek, int));
|
||||||
|
|||||||
Reference in New Issue
Block a user