mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
store rparen in ReturnType.Invalid
This is useful for getting a partial function signature
This commit is contained in:
parent
a32e240540
commit
c4552ee8ed
@ -897,7 +897,7 @@ pub const Node = struct {
|
||||
pub const ReturnType = union(enum) {
|
||||
Explicit: *Node,
|
||||
InferErrorSet: *Node,
|
||||
Invalid,
|
||||
Invalid: TokenIndex,
|
||||
};
|
||||
|
||||
pub fn iterate(self: *FnProto, index: usize) ?*Node {
|
||||
|
||||
@ -518,7 +518,7 @@ fn parseFnProto(arena: *Allocator, it: *TokenIterator, tree: *Tree) !?*Node {
|
||||
// TODO https://github.com/ziglang/zig/issues/3750
|
||||
const R = Node.FnProto.ReturnType;
|
||||
const return_type = if (return_type_expr == null)
|
||||
R{ .Invalid = {} }
|
||||
R{ .Invalid = rparen }
|
||||
else if (exclamation_token != null)
|
||||
R{ .InferErrorSet = return_type_expr.? }
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user