commit 1f3eeb5443ada8dbe9226f1bcc5322fd89c20d3e (tree)
parent 104ae419e4f8b327c354a9a6f02b52c9884aedf0
Author: Andrew Kelley <andrew@ziglang.org>
Date: Sun, 19 Apr 2020 03:29:07 -0400
ir: parse type noreturn
Diffstat:
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src-self-hosted/ir.zig b/src-self-hosted/ir.zig
@@ -237,6 +237,8 @@ fn parseOptionalType(ctx: *ParseContext) !?Type {
const type_text = mem.trim(u8, type_text_untrimmed, " \n");
if (mem.eql(u8, type_text, "usize")) {
return Type.initTag(.int_usize);
+ } else if (mem.eql(u8, type_text, "noreturn")) {
+ return Type.initTag(.no_return);
} else {
return parseError(ctx, "TODO parse type '{}'", .{type_text});
}
diff --git a/src-self-hosted/type.zig b/src-self-hosted/type.zig
@@ -75,6 +75,7 @@ pub const Type = extern union {
/// See `zigTypeTag` for the function that corresponds to `std.builtin.TypeId`.
pub const Tag = enum {
// The first section of this enum are tags that require no payload.
+ no_return,
int_comptime,
int_u8,
int_usize,