This commit is contained in:
Krzosa Karol
2022-04-30 12:28:34 +02:00
parent a5a3acf3ef
commit 3a9b748fed
15 changed files with 296 additions and 746 deletions

View File

@@ -93,8 +93,9 @@ Expr* parse_unary_expr(Parser* p) {
else if (token_is(p, TK_OpenParen)) { // cast requires lookahead
Token *token = token_peek(p, 1);
if (token->kind == TK_Keyword || token->kind == TK_Identifier) {
Type *type = type_get(p, token->intern_val);
if(type != type_undefined){
AST_Node *type = symbol_lookup_type(p, token->intern_val);
if(type){
token_next(p);
token_next(p);
// @Todo(Krzosa): Parse pointer types
@@ -105,6 +106,7 @@ Expr* parse_unary_expr(Parser* p) {
else {
result = parse_postfix_expr(p);
}
}
else {
result = parse_postfix_expr(p);