summary refs log tree commit diff
path: root/examples
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-15 00:46:15 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-15 00:46:15 +0100
commit875efb6a01514996ed7fff9d6714acc472928767 (patch)
treef389b076a0bcf2451f7a88595fc63016b1725e7c /examples
parentParser: clean (diff)
downloadinterpreter-875efb6a01514996ed7fff9d6714acc472928767.tar.gz
interpreter-875efb6a01514996ed7fff9d6714acc472928767.tar.bz2
interpreter-875efb6a01514996ed7fff9d6714acc472928767.zip
Add basic support for parsing functions
Diffstat (limited to 'examples')
-rw-r--r--examples/4.src7
-rw-r--r--examples/5.src7
2 files changed, 5 insertions, 9 deletions
diff --git a/examples/4.src b/examples/4.src
index e1ebcdc..25dcc7a 100644
--- a/examples/4.src
+++ b/examples/4.src
@@ -1,3 +1,6 @@
-let x = 2;
+let print_one = () => {
+	print(1);
+	return 1;
+};
 
-return x+1;
+print_one();
diff --git a/examples/5.src b/examples/5.src
deleted file mode 100644
index 521b9d7..0000000
--- a/examples/5.src
+++ /dev/null
@@ -1,7 +0,0 @@
-let print_one = () => {
-	print(1);
-};
-
-print_one();
-
-return 0;