diff options
Diffstat (limited to 'tnslc/compile/struct.tnsl')
| -rw-r--r-- | tnslc/compile/struct.tnsl | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tnslc/compile/struct.tnsl b/tnslc/compile/struct.tnsl index 45f85d3..780e8ad 100644 --- a/tnslc/compile/struct.tnsl +++ b/tnslc/compile/struct.tnsl @@ -149,13 +149,13 @@ struct Struct { return ;/ - /; if (ft`.size == 0) - # Recurse - ft`._compute_size(parent) - ;/ - /; if (ft`.size < 0) # Cyclical dependency + _printf("ERROR: Cyclic struct definition: '\0") + _printf(ft`.name) + _printf("' imported from '\0") + _printf(self.name) + _printf("'\n\0") return ;/ @@ -198,10 +198,13 @@ struct Struct { # Find struct and compute its size ~Struct out = parent`.find(SEARCH_STRUCT, ~sv) - sv.pop() - ~Module outp = parent - /; if (sv.count !== 0) - outp = parent`.find(SEARCH_SUB, ~sv) + /; if (out !== NULL && out`.size == 0) + sv.pop() + ~Module outp = parent + /; if (sv.count !== 0) + outp = parent`.find(SEARCH_SUB, ~sv) + ;/ + out`._compute_size(outp) ;/ sv.end() return out |