authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-19 03:29:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-19 19:31:50-04:00
log1f3eeb5443ada8dbe9226f1bcc5322fd89c20d3e
treea7e5b153a2984985b1b04599b7513e2abb989ac2
parent104ae419e4f8b327c354a9a6f02b52c9884aedf0

ir: parse type noreturn


2 files changed, 3 insertions(+), 0 deletions(-)

src-self-hosted/ir.zig+2
...@@ -237,6 +237,8 @@ fn parseOptionalType(ctx: *ParseContext) !?Type {...@@ -237,6 +237,8 @@ fn parseOptionalType(ctx: *ParseContext) !?Type {
237 const type_text = mem.trim(u8, type_text_untrimmed, " \n");237 const type_text = mem.trim(u8, type_text_untrimmed, " \n");
238 if (mem.eql(u8, type_text, "usize")) {238 if (mem.eql(u8, type_text, "usize")) {
239 return Type.initTag(.int_usize);239 return Type.initTag(.int_usize);
240 } else if (mem.eql(u8, type_text, "noreturn")) {
241 return Type.initTag(.no_return);
240 } else {242 } else {
241 return parseError(ctx, "TODO parse type '{}'", .{type_text});243 return parseError(ctx, "TODO parse type '{}'", .{type_text});
242 }244 }
src-self-hosted/type.zig+1
...@@ -75,6 +75,7 @@ pub const Type = extern union {...@@ -75,6 +75,7 @@ pub const Type = extern union {
75 /// See `zigTypeTag` for the function that corresponds to `std.builtin.TypeId`.75 /// See `zigTypeTag` for the function that corresponds to `std.builtin.TypeId`.
76 pub const Tag = enum {76 pub const Tag = enum {
77 // The first section of this enum are tags that require no payload.77 // The first section of this enum are tags that require no payload.
78 no_return,
78 int_comptime,79 int_comptime,
79 int_u8,80 int_u8,
80 int_usize,81 int_usize,