diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-05-14 00:40:19 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-05-14 00:40:19 -0400 |
commit | f836e1fc4729dcd14c5ef0b5953197b51db0a816 (patch) | |
tree | a0cd0d4f9a9b094b3ca54c96d5cb7be5dfc87994 | |
parent | 87fe73831fd1967b0ed48f8664305061dd0f34c5 (diff) |
Proper calling test
-rw-r--r-- | tnslc/tests/proper_calling.tnsl | 25 |
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 |