Implement loops #4

Merged
samsonium merged 24 commits from feat-loops into v1.1 2026-10-25 02:01:47 +00:00
4 changed files with 40 additions and 0 deletions
Showing only changes of commit 0188991f4d - Show all commits
+3
View File
@@ -0,0 +1,3 @@
for (int i = 0; i < 5; i = i - 1)
{}
+3
View File
@@ -0,0 +1,3 @@
while (true)
{}
+7
View File
@@ -0,0 +1,7 @@
int i = 0;
for (;;)
{
break;
}
+27
View File
@@ -0,0 +1,27 @@
for (int i = 0; i < 10; i = i + 1)
printline("check");
int i = 0;
for (i = 0; i <= 5; i = i + 1)
{
printline("i is:");
printline(i);
}
if (i < 5)
{
printline("external declared `i` != 5");
exit(1);
}
while (i > 0)
{
i = i - 1;
}
if (i > 0)
{
printline("decreased in while loop `i` > 0");
exit(1);
}