Remove old cast syntax.

This commit is contained in:
Christoffer Lerno
2021-05-18 22:54:01 +02:00
parent d663af1e1a
commit 11624e8eb1
5 changed files with 1 additions and 18 deletions

View File

@@ -403,7 +403,6 @@ typedef enum
TOKEN_ATTRIBUTE,
TOKEN_BREAK,
TOKEN_CASE,
TOKEN_CAST,
TOKEN_CATCH,
TOKEN_CONST,
TOKEN_CONTINUE,

View File

@@ -238,18 +238,6 @@ static Expr *parse_type_identifier(Context *context, Expr *left)
return parse_type_expression_with_path(context, NULL);
}
static Expr *parse_cast_expr(Context *context, Expr *left)
{
assert(!left && "Unexpected left hand side");
Expr *expr = EXPR_NEW_TOKEN(EXPR_CAST, context->tok);
advance_and_verify(context, TOKEN_CAST);
CONSUME_OR(TOKEN_LPAREN, poisoned_expr);
expr->cast_expr.expr = TRY_EXPR_OR(parse_expr(context), poisoned_expr);
CONSUME_OR(TOKEN_AS, poisoned_expr);
expr->cast_expr.type_info = TRY_TYPE_OR(parse_type(context), poisoned_expr);
CONSUME_OR(TOKEN_RPAREN, poisoned_expr);
return expr;
}
static Expr *parse_typeof_expr(Context *context, Expr *left)
{
assert(!left && "Unexpected left hand side");
@@ -1046,7 +1034,6 @@ ParseRule rules[TOKEN_EOF + 1] = {
[TOKEN_MINUSMINUS] = { parse_unary_expr, parse_post_unary, PREC_CALL },
[TOKEN_LPAREN] = { parse_grouping_expr, parse_call_expr, PREC_CALL },
[TOKEN_LBRAPIPE] = { parse_expr_block, NULL, PREC_NONE },
[TOKEN_CAST] = { parse_cast_expr, NULL, PREC_NONE },
[TOKEN_TYPEOF] = { parse_typeof_expr, NULL, PREC_NONE },
[TOKEN_TRY] = { parse_try_expr, NULL, PREC_NONE },
[TOKEN_CATCH] = { parse_try_expr, NULL, PREC_NONE },

View File

@@ -1091,7 +1091,6 @@ Ast *parse_stmt(Context *context)
case TOKEN_CT_IDENT:
case TOKEN_STRING:
case TOKEN_REAL:
case TOKEN_CAST:
case TOKEN_FALSE:
case TOKEN_NULL:
case TOKEN_TRUE:

View File

@@ -186,8 +186,6 @@ const char *token_type_to_string(TokenType type)
return "break";
case TOKEN_CASE:
return "case";
case TOKEN_CAST:
return "cast";
case TOKEN_CATCH:
return "catch";
case TOKEN_CONST:

View File

@@ -1 +1 @@
#define COMPILER_VERSION "A221"
#define COMPILER_VERSION "A222"