From f836e1fc4729dcd14c5ef0b5953197b51db0a816 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 14 May 2023 00:40:19 -0400 Subject: Proper calling test --- tnslc/tests/proper_calling.tnsl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tnslc/tests/proper_calling.tnsl (limited to 'tnslc/tests') 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 -- cgit v1.2.3