new unreachable syntax

* `noreturn` is the primitive type.
 * `unreachable` is a control flow keyword.
 * `@unreachable()` builtin function is deleted.

closes #214
This commit is contained in:
Andrew Kelley
2017-03-26 04:58:48 -04:00
parent 22e6bfca96
commit 451ce09067
35 changed files with 130 additions and 192 deletions

View File

@@ -216,6 +216,8 @@ static const char *node_type_str(NodeType node_type) {
return "Break";
case NodeTypeContinue:
return "Continue";
case NodeTypeUnreachable:
return "Unreachable";
case NodeTypeAsmExpr:
return "AsmExpr";
case NodeTypeFieldAccessExpr:
@@ -890,6 +892,11 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
fprintf(ar->f, "continue");
break;
}
case NodeTypeUnreachable:
{
fprintf(ar->f, "unreachable");
break;
}
case NodeTypeSliceExpr:
{
render_node_ungrouped(ar, node->data.slice_expr.array_ref_expr);