about summary refs log tree commit diff
path: root/examples/10.src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-03-12 00:47:31 +0100
committerBaitinq <[email protected]>2025-03-12 00:47:43 +0100
commitda0788140e7afbc9b0bcbb937a29e2b08de08ec7 (patch)
treeef6435c7c91f40926f01f5faa9b4dbc2946a5caf /examples/10.src
parentCodegen: add bundled llvm (diff)
parentCodegen: Fix bug with functions without name (diff)
downloadpry-lang-da0788140e7afbc9b0bcbb937a29e2b08de08ec7.tar.gz
pry-lang-da0788140e7afbc9b0bcbb937a29e2b08de08ec7.tar.bz2
pry-lang-da0788140e7afbc9b0bcbb937a29e2b08de08ec7.zip
Merge branch 'master' into native-llvm
Diffstat (limited to 'examples/10.src')
-rw-r--r--examples/10.src10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/10.src b/examples/10.src
index 0ec38ea..59f91e1 100644
--- a/examples/10.src
+++ b/examples/10.src
@@ -1,14 +1,16 @@
 let main = () => i64 {
 	let counter = 0;
 
-	while !(counter == 10) {
+	while counter < 10 {
 		print(counter);
 		counter = counter + 1;
 	};
 
-	while counter == 0 {
-		print(0);
+	while true {
+		if counter == 10 {
+			return counter;
+		};
 	};
 
-	return counter;
+	return 1;
 };