From 89f2b3b4a40749eba388ea998b99381a37bbeb53 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 14 May 2023 11:43:43 -0400 Subject: Indexing and proper string decomp --- tnslc/tests/proper_calling.tnsl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tnslc/tests/proper_calling.tnsl (limited to 'tnslc/tests/proper_calling.tnsl') diff --git a/tnslc/tests/proper_calling.tnsl b/tnslc/tests/proper_calling.tnsl new file mode 100644 index 0000000..6fd5e69 --- /dev/null +++ b/tnslc/tests/proper_calling.tnsl @@ -0,0 +1,21 @@ +struct CallMe { + int a, b +} + +/; method CallMe + /; call_two (int a, b) [int] + return a + b + self.a + self.b + ;/ + + /; call_four (int a, b, c, d) [int] + return self.call_two(a + b, b * c + d) + self.call_two(a * b + c, c + d) + ;/ + +;/ + +/; main [int] + CallMe cm + cm.a = 0 + cm.b = 0 + return cm.call_four(0, 2, 2, 0) +;/ \ No newline at end of file -- cgit v1.2.3