summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/parse.c b/parse.c
index 7a1e59e..9266cfe 100644
--- a/parse.c
+++ b/parse.c
@@ -396,10 +396,6 @@ static Token *expr_find_end(Parser *p, ExprEndFlags flags) {
if (all_levels_0 && (flags & EXPR_CAN_END_WITH_EQ))
return token;
break;
- case KW_WHERE:
- if (all_levels_0 && (flags & EXPR_CAN_END_WITH_WHERE))
- return token;
- break;
case KW_COLON:
if ((flags & EXPR_CAN_END_WITH_COLON) && all_levels_0)
return token;
@@ -807,7 +803,7 @@ static bool parser_is_definitely_type(Parser *p, Token **end) {
--paren_level;
if (paren_level == 0) {
++t->token;
- if (token_is_kw(t->token, KW_LBRACE) || token_is_kw(t->token, KW_WHERE)) goto end; /* void fn expr */
+ if (token_is_kw(t->token, KW_LBRACE)) goto end; /* void fn expr */
if (is_decl(t)) /* has return declaration */
goto end;
@@ -959,7 +955,6 @@ static Status parse_fn_expr(Parser *p, FnExpr *f) {
f->instance_id = 0;
f->ret_decls = NULL;
f->instances = NULL;
- f->condition = NULL;
/* only called when token is fn */
assert(token_is_kw(t->token, KW_FN));
++t->token;
@@ -990,7 +985,7 @@ static Status parse_fn_expr(Parser *p, FnExpr *f) {
success = false; goto ret;
}
- if (token_is_kw(t->token, KW_LBRACE) || token_is_kw(t->token, KW_WHERE)) {
+ if (token_is_kw(t->token, KW_LBRACE)) {
/* void function */
f->ret_type.kind = TYPE_VOID;
f->ret_type.flags = 0;
@@ -1017,13 +1012,6 @@ static Status parse_fn_expr(Parser *p, FnExpr *f) {
goto ret;
}
}
- if (token_is_kw(t->token, KW_WHERE)) {
- ++t->token;
- f->condition = parser_new_expr(p);
- if (!parse_expr(p, f->condition, expr_find_end(p, EXPR_CAN_END_WITH_LBRACE))) {
- return false;
- }
- }
p->block = prev_block; /* be nice to parse_block */
if (!parse_block(p, &f->body, PARSE_BLOCK_DONT_CREATE_IDENTS))
success = false;