diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-02-16 05:43:13 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-02-16 05:43:13 -0500 |
commit | 5082b8602e5e731ef78a569c4c153ffeea017758 (patch) | |
tree | e694318ebb41abef87e911a3f6d34888bd71f7b5 | |
parent | 4ee14bcffda862335901fd2050c09c10636ca0a6 (diff) |
Struct in struct definition
-rw-r--r-- | tnslc/test.tnsl | 12 | ||||
-rw-r--r-- | tnslc/tnslc.tnsl | 4 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tnslc/test.tnsl b/tnslc/test.tnsl index b274dfd..7e5112a 100644 --- a/tnslc/test.tnsl +++ b/tnslc/test.tnsl @@ -6,8 +6,8 @@ struct ARRAY_TEST { {}PTR_TEST dat } -enum ENUM_TEST [{}int] { - A = {2, 3, 4, 5, 623459}, +enum ENUM_TEST [{}uint8] { + A = "nizsdd", B = {1, 2} } @@ -16,6 +16,14 @@ enum EN_ARR [PTR_TEST] { B = {3, 4} } +struct A { + B nxta +} + +struct B { + ~A dat +} + /; main [int] return EN_ARR.A.dat ;/
\ No newline at end of file diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl index 8bad758..aea8bca 100644 --- a/tnslc/tnslc.tnsl +++ b/tnslc/tnslc.tnsl @@ -1084,7 +1084,9 @@ ;; else if (p >== 0) ;s = s + p ;; else - ;~Type tp = m`.find_type(t`.members{i}.data_type.name) + ;tnsl.io.println("STRUCT!!!!!!") + ;{}{}uint8 artifact = { t`.members{i}.data_type.name } + ;~Type tp = m`.find_type(artifact) /; if (tp`.s == 0) ;size_struct(tp, m) ;/ |