diff options
-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 |