summaryrefslogtreecommitdiff
path: root/tnslc/simple.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2023-08-31 01:00:44 -0400
committerKyle Gunger <kgunger12@gmail.com>2023-08-31 01:00:44 -0400
commit3bfdbd26958e3b8193500dd5fad8dcd58c5a8457 (patch)
tree59329ed9c362afc504d20f38a51e95bf93704202 /tnslc/simple.tnsl
parent346bc784bedcd00ca8037b5c5a4194c0af9757fb (diff)
Updates to include new c_wrap
Diffstat (limited to 'tnslc/simple.tnsl')
-rw-r--r--tnslc/simple.tnsl47
1 files changed, 20 insertions, 27 deletions
diff --git a/tnslc/simple.tnsl b/tnslc/simple.tnsl
index 90ee758..75b91bd 100644
--- a/tnslc/simple.tnsl
+++ b/tnslc/simple.tnsl
@@ -1,36 +1,29 @@
# No longer simple
-:include "c_wrap.tnsl"
+:include "c_wrap_linux.tnsl"
-enum LOL [int] {
- A = 1,
- B = 2,
- C = 4
-}
-
-struct Lolbert {
- int a, b, c,
+{}uint8 str = "Hello copy!\n\0"
- ~uint8 stuff
+struct Copier {
+ ~uint8 h8r
}
-/; lolbert1 (~Lolbert l, uint8 check) [bool]
- return l`.a == check
-;/
+/; method Copier
+ /; copy [Copier]
+ Copier out
+ out.h8r = self.h8r
+ return out
+ ;/
-/; main [int]
- Lolbert lol
- lol.a = 1
- lol.b = 4
- lol.c = 3
- lol.stuff = _alloc(2)
- lol.stuff{0} = 2
- lol.stuff{1} = 1
+;/
- /; if (lolbert1(~lol, lol.stuff{1}) && lolbert1(~lol, lol.stuff{0}))
- _delete(lol.stuff)
- return lol.a + lol.b
- ;/
- _delete(lol.stuff)
+/; main
+ Copier a
+ a.h8r = ~str{0}
+ ~Copier b
+ b = ~a
+ Copier c = b`.copy()
+ _printf(c.h8r)
return 0
-;/ \ No newline at end of file
+;/
+