aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-27 23:40:36 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-07-19 18:18:44 -0400
commit54e716afdcb0609cfc42229ad925e6dc9b07a66f (patch)
tree8a9442a1ebc5a77a9005f457c417cdd2fdf3254e /src/parser.cpp
parentf429f4dcabec2324b76b900f5785204897ea7685 (diff)
downloadzig-54e716afdcb0609cfc42229ad925e6dc9b07a66f.tar.gz
zig-54e716afdcb0609cfc42229ad925e6dc9b07a66f.zip
remove coroutines implementation and promise type
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index fe1f89ac92..b1a593d9c9 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -282,9 +282,6 @@ static AstNode *ast_parse_prefix_op_expr(
case NodeTypeAwaitExpr:
right = &prefix->data.await_expr.expr;
break;
- case NodeTypePromiseType:
- right = &prefix->data.promise_type.payload_type;
- break;
case NodeTypeArrayType:
right = &prefix->data.array_type.child_type;
break;
@@ -1643,10 +1640,6 @@ static AstNode *ast_parse_primary_type_expr(ParseContext *pc) {
if (null != nullptr)
return ast_create_node(pc, NodeTypeNullLiteral, null);
- Token *promise = eat_token_if(pc, TokenIdKeywordPromise);
- if (promise != nullptr)
- return ast_create_node(pc, NodeTypePromiseType, promise);
-
Token *true_token = eat_token_if(pc, TokenIdKeywordTrue);
if (true_token != nullptr) {
AstNode *res = ast_create_node(pc, NodeTypeBoolLiteral, true_token);
@@ -2042,11 +2035,6 @@ static Optional<AstNodeFnProto> ast_parse_fn_cc(ParseContext *pc) {
}
if (eat_token_if(pc, TokenIdKeywordAsync) != nullptr) {
res.cc = CallingConventionAsync;
- if (eat_token_if(pc, TokenIdCmpLessThan) == nullptr)
- return Optional<AstNodeFnProto>::some(res);
-
- res.async_allocator_type = ast_expect(pc, ast_parse_type_expr);
- expect_token(pc, TokenIdCmpGreaterThan);
return Optional<AstNodeFnProto>::some(res);
}
@@ -2533,16 +2521,6 @@ static AstNode *ast_parse_prefix_type_op(ParseContext *pc) {
return res;
}
- Token *promise = eat_token_if(pc, TokenIdKeywordPromise);
- if (promise != nullptr) {
- if (eat_token_if(pc, TokenIdArrow) != nullptr) {
- AstNode *res = ast_create_node(pc, NodeTypePromiseType, promise);
- return res;
- }
-
- put_back_token(pc);
- }
-
AstNode *array = ast_parse_array_type_start(pc);
if (array != nullptr) {
assert(array->type == NodeTypeArrayType);
@@ -2680,11 +2658,6 @@ static AstNode *ast_parse_async_prefix(ParseContext *pc) {
AstNode *res = ast_create_node(pc, NodeTypeFnCallExpr, async);
res->data.fn_call_expr.is_async = true;
res->data.fn_call_expr.seen = false;
- if (eat_token_if(pc, TokenIdCmpLessThan) != nullptr) {
- AstNode *prefix_expr = ast_expect(pc, ast_parse_prefix_expr);
- expect_token(pc, TokenIdCmpGreaterThan);
- res->data.fn_call_expr.async_allocator = prefix_expr;
- }
return res;
}
@@ -2858,7 +2831,6 @@ void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *cont
visit_node_list(&node->data.fn_proto.params, visit, context);
visit_field(&node->data.fn_proto.align_expr, visit, context);
visit_field(&node->data.fn_proto.section_expr, visit, context);
- visit_field(&node->data.fn_proto.async_allocator_type, visit, context);
break;
case NodeTypeFnDef:
visit_field(&node->data.fn_def.fn_proto, visit, context);
@@ -2918,7 +2890,6 @@ void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *cont
case NodeTypeFnCallExpr:
visit_field(&node->data.fn_call_expr.fn_ref_expr, visit, context);
visit_node_list(&node->data.fn_call_expr.params, visit, context);
- visit_field(&node->data.fn_call_expr.async_allocator, visit, context);
break;
case NodeTypeArrayAccessExpr:
visit_field(&node->data.array_access_expr.array_ref_expr, visit, context);
@@ -3034,9 +3005,6 @@ void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *cont
case NodeTypeInferredArrayType:
visit_field(&node->data.array_type.child_type, visit, context);
break;
- case NodeTypePromiseType:
- visit_field(&node->data.promise_type.payload_type, visit, context);
- break;
case NodeTypeErrorType:
// none
break;