summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-10-30 21:17:42 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-10-30 21:17:42 -0400
commit4ee46b53971e876d93fea0c0a2ba358cad51be21 (patch)
tree431d4694c62236b36a2e10fbb2ca50b3d4aff7e1 /types.h
parentfdc1946407222c340609d6c993138690a508a641 (diff)
probably got structs working (but not .)
Diffstat (limited to 'types.h')
-rw-r--r--types.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/types.h b/types.h
index f5e25e7..e8c739f 100644
--- a/types.h
+++ b/types.h
@@ -88,6 +88,7 @@ typedef union Value {
struct FnExpr *fn;
void *arr;
void *ptr;
+ void *struc;
union Value *tuple;
Slice slice;
struct Type *type;
@@ -272,10 +273,12 @@ typedef enum {
typedef struct {
Identifier name;
struct Type *type;
+ size_t offset; /* offset during compile time */
} Field;
#define TYPE_FLAG_FLEXIBLE 0x01
#define TYPE_FLAG_RESOLVED 0x02
+#define TYPE_FLAG_STRUCT_FOUND_OFFSETS 0x04
typedef struct Type {
Location where;
@@ -301,6 +304,7 @@ typedef struct Type {
} user;
struct {
Field *fields;
+ size_t size; /* size of this struct during compile time */
} struc;
};
} Type;