about summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-03-09 09:52:54 +0100
committerBaitinq <[email protected]>2025-03-09 09:52:54 +0100
commit21432e8965403975a3f8e9175a46430b7b818241 (patch)
tree32780c229213c6df29f68cbd90dbe1c5de7a5895 /examples
parentFeature: Add support for mod operator (diff)
downloadpry-lang-21432e8965403975a3f8e9175a46430b7b818241.tar.gz
pry-lang-21432e8965403975a3f8e9175a46430b7b818241.tar.bz2
pry-lang-21432e8965403975a3f8e9175a46430b7b818241.zip
Codegen: Fix bug with if statements inside while loops
Diffstat (limited to 'examples')
-rw-r--r--examples/10.src8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/10.src b/examples/10.src
index b840849..59f91e1 100644
--- a/examples/10.src
+++ b/examples/10.src
@@ -6,9 +6,11 @@ let main = () => i64 {
 		counter = counter + 1;
 	};
 
-	while counter % 3 == 0 {
-		print(0);
+	while true {
+		if counter == 10 {
+			return counter;
+		};
 	};
 
-	return counter;
+	return 1;
 };