complete M7 type metadata
This commit is contained in:
+8
-5
@@ -4,9 +4,10 @@
|
|||||||
#include "ast.h"
|
#include "ast.h"
|
||||||
|
|
||||||
typedef enum FeTypeKind {
|
typedef enum FeTypeKind {
|
||||||
FE_TYPE_ERROR, FE_TYPE_ERROR_UNION, FE_TYPE_VOID, FE_TYPE_BOOL, FE_TYPE_CHAR, FE_TYPE_INT,
|
FE_TYPE_ERROR, FE_TYPE_ERROR_UNION, FE_TYPE_OPTIONAL,
|
||||||
|
FE_TYPE_VOID, FE_TYPE_BOOL, FE_TYPE_CHAR, FE_TYPE_INT,
|
||||||
FE_TYPE_STRUCT, FE_TYPE_ENUM, FE_TYPE_ARRAY, FE_TYPE_SLICE, FE_TYPE_STR,
|
FE_TYPE_STRUCT, FE_TYPE_ENUM, FE_TYPE_ARRAY, FE_TYPE_SLICE, FE_TYPE_STR,
|
||||||
FE_TYPE_REF, FE_TYPE_OWNED, FE_TYPE_OPTIONAL, FE_TYPE_UNKNOWN
|
FE_TYPE_REF, FE_TYPE_OWNED, FE_TYPE_UNKNOWN
|
||||||
} FeTypeKind;
|
} FeTypeKind;
|
||||||
|
|
||||||
typedef struct FeFieldType FeFieldType;
|
typedef struct FeFieldType FeFieldType;
|
||||||
@@ -33,6 +34,8 @@ struct FeType {
|
|||||||
char name[64];
|
char name[64];
|
||||||
char *cname;
|
char *cname;
|
||||||
char *maker;
|
char *maker;
|
||||||
|
char *none_cname;
|
||||||
|
char *unwrap_cname;
|
||||||
char *indexer;
|
char *indexer;
|
||||||
char *slicer;
|
char *slicer;
|
||||||
char *full_slicer;
|
char *full_slicer;
|
||||||
@@ -48,10 +51,10 @@ struct FeType {
|
|||||||
unsigned long length;
|
unsigned long length;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
unsigned align;
|
unsigned align;
|
||||||
|
/* Element/payload type for refs, owners, slices and optionals. For an
|
||||||
|
error union this is the nominal error identity; NULL means core.Error. */
|
||||||
FeType *elem;
|
FeType *elem;
|
||||||
/* Success value for an error union; !void is represented directly.
|
/* Success value for an error union. */
|
||||||
For a nominal E!T created by M7, elem holds E. A null elem denotes
|
|
||||||
the built-in core.Error shorthand !T. */
|
|
||||||
FeType *error_value;
|
FeType *error_value;
|
||||||
int ref_mut;
|
int ref_mut;
|
||||||
FeFieldType *fields;
|
FeFieldType *fields;
|
||||||
|
|||||||
Reference in New Issue
Block a user