summaryrefslogtreecommitdiff
path: root/tnslc
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-05-14 00:40:19 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-05-14 00:40:19 -0400
commitf836e1fc4729dcd14c5ef0b5953197b51db0a816 (patch)
treea0cd0d4f9a9b094b3ca54c96d5cb7be5dfc87994 /tnslc
parent87fe73831fd1967b0ed48f8664305061dd0f34c5 (diff)
Proper calling test
Diffstat (limited to 'tnslc')
-rw-r--r--tnslc/tests/proper_calling.tnsl25
1 files changed, 25 insertions, 0 deletions
diff --git a/tnslc/tests/proper_calling.tnsl b/tnslc/tests/proper_calling.tnsl
new file mode 100644
index 0000000..4480b31
--- /dev/null
+++ b/tnslc/tests/proper_calling.tnsl
@@ -0,0 +1,25 @@
+struct CallMe {
+ int a, b
+}
+
+/; method CallMe
+ /; call_two (int a, b) [int]
+ return a + b + self.a + self.b
+ ;/
+
+ /; call_three (int a, b, c) [int]
+ return self.call_two(a, b) + self.call_two(a, b) + c
+ ;/
+
+ /; call_four (int a, b, c, d) [int]
+ return self.call_three(a, b, c) + self.call_three(b, c, d)
+ ;/
+
+;/
+
+/; main [int]
+ CallMe cm
+ cm.a = 0
+ cm.b = 0
+ return cm.call_four(2, 0, 0, 1)
+;/ \ No newline at end of file