From 5082b8602e5e731ef78a569c4c153ffeea017758 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Thu, 16 Feb 2023 05:43:13 -0500 Subject: Struct in struct definition --- tnslc/test.tnsl | 12 ++++++++++-- tnslc/tnslc.tnsl | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'tnslc') 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) ;/ -- cgit v1.2.3