summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-19 16:04:08 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-19 16:43:59 +0100
commit44ec5d5de6a558fc20b8452a1ee743b64d56e5e5 (patch)
treee6b3f445aa8578b2bcaa5de2d2d91214755230b9 /examples
parentFeature: Add support for boolean values (diff)
downloadinterpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.tar.gz
interpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.tar.bz2
interpreter-44ec5d5de6a558fc20b8452a1ee743b64d56e5e5.zip
Feature: Add basic support for equality expression
Diffstat (limited to 'examples')
-rw-r--r--examples/7.src2
-rw-r--r--examples/8.src4
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/7.src b/examples/7.src
index 0cb0721..b96cba8 100644
--- a/examples/7.src
+++ b/examples/7.src
@@ -1,7 +1,7 @@
 let main = () => {
 	let i = 4;
 	
-	if i - 4 {
+	if i + 1 == 5 {
 		print(i);
 		return i;
 	};
diff --git a/examples/8.src b/examples/8.src
index 1ec46e4..33323f7 100644
--- a/examples/8.src
+++ b/examples/8.src
@@ -1,8 +1,8 @@
 let fib = (n) => {
-	if n {
+	if n == 0 {
 		return 0;
 	};
-	if n - 1 {
+	if n == 1 {
 		return 1;
 	};
 	return fib(n-2) + fib(n-1);