Added pointer type resolution

This commit is contained in:
Alexandros Naskos 2020-05-13 22:35:14 +03:00
parent 0e0789b2d5
commit be95849a15

View File

@ -223,6 +223,15 @@ pub fn resolveTypeOfNode(tree: *std.zig.ast.Tree, node: *std.zig.ast.Node) ?*std
else => {} else => {}
} }
}, },
.PrefixOp => {
const prefix_op = node.cast(std.zig.ast.Node.PrefixOp).?;
switch (prefix_op.op) {
.PtrType => {
return resolveTypeOfNode(tree, prefix_op.rhs);
},
else => {}
}
},
else => { else => {
std.debug.warn("Type resolution case not implemented; {}\n", .{node.id}); std.debug.warn("Type resolution case not implemented; {}\n", .{node.id});
} }
@ -247,7 +256,7 @@ pub fn getNodeFromTokens(tree: *std.zig.ast.Tree, node: *std.zig.ast.Node, token
if (resolveTypeOfNode(tree, child)) |child_type| { if (resolveTypeOfNode(tree, child)) |child_type| {
current_node = child_type; current_node = child_type;
} else return null; } else return null;
} } else return null;
} else return null; } else return null;
}, },
.Period => { .Period => {