From 1949636463f53675f04e1315ad84ecc87def57cb Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 25 Mar 2020 23:38:15 -0400 Subject: improved struct member lookup --- types.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'types.h') diff --git a/types.h b/types.h index 710faf8..a3a211a 100644 --- a/types.h +++ b/types.h @@ -522,7 +522,12 @@ typedef struct StructDef { Location where; U8 flags; - Block scope; /* parameters and constants live here. statements aren't used after resolving (but are kept around because why not) */ + /* + use this instead of fields when looking up a field, because it will include "use"d things. + this only consists of statements which are declarations after typing (and not #ifs, + for example) + */ + Block body; union { HashTable instances; struct { @@ -888,6 +893,7 @@ typedef struct Declaration { DeclFlags flags; union { Expression expr; + Field *field; /* pointer to the field which the first identifier in this decl refers to */ struct { union { struct { -- cgit v1.2.3