Updated TODO

This commit is contained in:
Christoffer Lerno
2020-04-09 17:26:34 +02:00
committed by Christoffer Lerno
parent eabef8f468
commit 9bf89574f9
2 changed files with 42 additions and 2 deletions

View File

@@ -47,16 +47,15 @@ Things missing:
- Disallow x >= 0 and x < 0 on unsigned types unless in a macro.
- Range check arrays on debug
- 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
- String switch
- Range case
* Functions
- Varargs
- C ABI
- Safe varargs
- Named parameters
* Pre-post conditions
- Breakdown here

View File

@@ -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);
}
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)
{
printf("Helo!\n");
testDefault(y = 99);
testPointers(2, 3);
testDefer();
int efd = 9;
uint fefoek = 1;
printf("Helo: %d\n", efd + cast(fefoek, int));