parse async fn calls and cancel expressions

This commit is contained in:
Andrew Kelley
2018-02-20 00:05:38 -05:00
parent af10b0fec2
commit 3d58d7232a
9 changed files with 171 additions and 7 deletions

View File

@@ -244,6 +244,8 @@ static const char *node_type_str(NodeType node_type) {
return "TestExpr";
case NodeTypeErrorSetDecl:
return "ErrorSetDecl";
case NodeTypeCancel:
return "Cancel";
}
zig_unreachable();
}
@@ -1037,6 +1039,12 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
fprintf(ar->f, "}");
break;
}
case NodeTypeCancel:
{
fprintf(ar->f, "cancel ");
render_node_grouped(ar, node->data.cancel_expr.expr);
break;
}
case NodeTypeFnDecl:
case NodeTypeParamDecl:
case NodeTypeTestDecl: