diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-03-23 01:30:03 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-03-23 01:30:03 -0400 |
commit | a81122df8f081fc6f7cbe338f094bd8da9ba0486 (patch) | |
tree | 950b7d44618d7c8f40c23f210502badf90844d6a /tnslc/simple.tnsl | |
parent | 9066d5215225a32865cb628dad1c69997efffe62 (diff) |
Make `self` a valid name in method blocks
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r-- | tnslc/simple.tnsl | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl index 1d9bd30..6ac7f31 100644 --- a/tnslc/simple.tnsl +++ b/tnslc/simple.tnsl @@ -1,32 +1,14 @@ -/; module mod - uint a = 2, b = 4 - {}uint8 str = "Hello", c = "#" - {}int arr_i = {2, 3, 4, 5} - - struct test { - int i, j, - bool k, - uint8 m - } -;/ - -mod.test tv = { - 1, 2, false, 0 -} - -mod.test sv = { - 4, 5, true, 6 +struct Test { + int i } -/; main [int] - ~uint8 i = ~mod.str{0} - bool b = i` > i` - /; loop (i` < 81) - i` = i` + 2 - /; if (i` == 80) - i` = i` + 5 - ;/ +/; method Test + /; whatever [int] + return self.i ;/ - return i` ;/ + +/; main [int] + return 0 +;/
\ No newline at end of file |