ir: parse type noreturn
This commit is contained in:
parent
104ae419e4
commit
1f3eeb5443
@ -237,6 +237,8 @@ fn parseOptionalType(ctx: *ParseContext) !?Type {
|
|||||||
const type_text = mem.trim(u8, type_text_untrimmed, " \n");
|
const type_text = mem.trim(u8, type_text_untrimmed, " \n");
|
||||||
if (mem.eql(u8, type_text, "usize")) {
|
if (mem.eql(u8, type_text, "usize")) {
|
||||||
return Type.initTag(.int_usize);
|
return Type.initTag(.int_usize);
|
||||||
|
} else if (mem.eql(u8, type_text, "noreturn")) {
|
||||||
|
return Type.initTag(.no_return);
|
||||||
} else {
|
} else {
|
||||||
return parseError(ctx, "TODO parse type '{}'", .{type_text});
|
return parseError(ctx, "TODO parse type '{}'", .{type_text});
|
||||||
}
|
}
|
||||||
|
@ -75,6 +75,7 @@ pub const Type = extern union {
|
|||||||
/// See `zigTypeTag` for the function that corresponds to `std.builtin.TypeId`.
|
/// See `zigTypeTag` for the function that corresponds to `std.builtin.TypeId`.
|
||||||
pub const Tag = enum {
|
pub const Tag = enum {
|
||||||
// The first section of this enum are tags that require no payload.
|
// The first section of this enum are tags that require no payload.
|
||||||
|
no_return,
|
||||||
int_comptime,
|
int_comptime,
|
||||||
int_u8,
|
int_u8,
|
||||||
int_usize,
|
int_usize,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user