summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/types.h b/types.h
index 132a92f..195c97e 100644
--- a/types.h
+++ b/types.h
@@ -253,9 +253,10 @@ typedef enum {
DIRECT_COUNT
} Directive;
-static const char *directives[DIRECT_COUNT] =
- {"C", "sizeof", "alignof", "export", "foreign", "builtin", "include", "force", "if", "error", "warn",
- "info"};
+static const char *directives[DIRECT_COUNT] = {
+ "C", "sizeof", "alignof", "export", "foreign", "builtin", "include", "force", "if", "error", "warn",
+ "info"
+};
typedef enum {
KW_SEMICOLON,
@@ -320,6 +321,7 @@ typedef enum {
KW_TRUE,
KW_FALSE,
KW_NMS,
+ KW_USE,
KW_TYPEOF,
KW_SIZEOF,
KW_ALIGNOF,
@@ -336,8 +338,8 @@ static const char *const keywords[KW_COUNT] = {
"continue", "defer", "fn", "as", "struct",
"int", "i8", "i16", "i32", "i64",
"u8", "u16", "u32", "u64", "float", "f32", "f64", "Type",
- "Namespace",
- "char", "bool", "true", "false", "nms", "typeof", "sizeof", "alignof"
+ "Namespace", "char", "bool", "true", "false", "nms", "use",
+ "typeof", "sizeof", "alignof"
};
typedef enum {
@@ -915,7 +917,8 @@ typedef enum {
STMT_CONT,
STMT_INCLUDE,
STMT_MESSAGE,
- STMT_DEFER
+ STMT_DEFER,
+ STMT_USE
} StatementKind;
enum {
@@ -981,6 +984,7 @@ typedef struct Statement {
Message message; /* #error, #warn, #info */
Block *referring_to; /* for break/continue; set during typing */
struct Statement *defer;
+ Expression use;
};
} Statement;