remove useless nosuspend parsing

nosuspend cannot be used in a type expression and
all other use casesare covered by PrimaryExpr
This commit is contained in:
Vexu
2020-05-14 11:19:14 +03:00
parent c3b76d0913
commit ac319b2734
3 changed files with 3 additions and 19 deletions

View File

@@ -1609,7 +1609,6 @@ static AstNode *ast_parse_suffix_expr(ParseContext *pc) {
// / IfTypeExpr
// / INTEGER
// / KEYWORD_comptime TypeExpr
// / KEYWORD_nosuspend TypeExpr
// / KEYWORD_error DOT IDENTIFIER
// / KEYWORD_false
// / KEYWORD_null
@@ -1711,14 +1710,6 @@ static AstNode *ast_parse_primary_type_expr(ParseContext *pc) {
return res;
}
Token *nosuspend = eat_token_if(pc, TokenIdKeywordNoSuspend);
if (nosuspend != nullptr) {
AstNode *expr = ast_expect(pc, ast_parse_type_expr);
AstNode *res = ast_create_node(pc, NodeTypeNoSuspend, nosuspend);
res->data.nosuspend_expr.expr = expr;
return res;
}
Token *error = eat_token_if(pc, TokenIdKeywordError);
if (error != nullptr) {
Token *dot = expect_token(pc, TokenIdDot);