transmute(type)x; Minor code clean up

This commit is contained in:
Ginger Bill
2017-07-30 14:52:42 +01:00
parent 655931f0ea
commit 62a72f0163
16 changed files with 808 additions and 188 deletions

View File

@@ -2850,6 +2850,13 @@ AstNode *parse_unary_expr(AstFile *f, bool lhs) {
Token close = expect_token(f, Token_CloseParen);
return ast_type_cast(f, token, type, parse_unary_expr(f, lhs));
} break;
case Token_transmute: {
Token token = expect_token(f, Token_transmute);
Token open = expect_token_after(f, Token_OpenParen, "transmute");
AstNode *type = parse_type(f);
Token close = expect_token(f, Token_CloseParen);
return ast_type_cast(f, token, type, parse_unary_expr(f, lhs));
} break;
}
AstNode *operand = parse_operand(f, lhs);