add the anyframe and anyframe->T types

This commit is contained in:
Andrew Kelley
2019-07-26 19:52:35 -04:00
parent 018a89c7a1
commit ee64a22045
19 changed files with 337 additions and 50 deletions

View File

@@ -259,6 +259,8 @@ static const char *node_type_str(NodeType node_type) {
return "Suspend";
case NodeTypePointerType:
return "PointerType";
case NodeTypeAnyFrameType:
return "AnyFrameType";
case NodeTypeEnumLiteral:
return "EnumLiteral";
}
@@ -847,6 +849,14 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
render_node_ungrouped(ar, node->data.inferred_array_type.child_type);
break;
}
case NodeTypeAnyFrameType: {
fprintf(ar->f, "anyframe");
if (node->data.anyframe_type.payload_type != nullptr) {
fprintf(ar->f, "->");
render_node_grouped(ar, node->data.anyframe_type.payload_type);
}
break;
}
case NodeTypeErrorType:
fprintf(ar->f, "anyerror");
break;