summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-20 00:51:23 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-20 00:51:23 +0100
commitb0e2d13f1134f4b9b640012632004eb7f1dd447d (patch)
tree536bbc64b2a70c4d4bb5a27dfdb988ab02005cc5
parentStart working on proper operator precedence (diff)
downloadinterpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.tar.gz
interpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.tar.bz2
interpreter-b0e2d13f1134f4b9b640012632004eb7f1dd447d.zip
Example: Add example for while loop
-rw-r--r--examples/10.src13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/10.src b/examples/10.src
new file mode 100644
index 0000000..38e6259
--- /dev/null
+++ b/examples/10.src
@@ -0,0 +1,13 @@
+let main = () => {
+	let counter = 0;
+
+	while !(counter == 10) {
+		print(counter);
+	};
+
+	while counter == 0 {
+		print(0);
+	};
+
+	return counter;
+};