Basic type conversion when assigning, added + - unary

This commit is contained in:
Krzosa Karol
2022-06-03 10:48:07 +02:00
parent e2e684294e
commit 081e559520
7 changed files with 95 additions and 20 deletions

View File

@@ -312,6 +312,8 @@ binding_power(Binding binding, Token_Kind kind){
case TK_OpenBracket:
case TK_Keyword:
case TK_OpenParen:
case TK_Sub:
case TK_Add:
return{-2, 20};
default: return {-1, -1};
}
@@ -365,6 +367,8 @@ parse_expr(S64 min_bp){
case TK_Float : left = ast_float(token, token->f64_val); break;
case TK_Pointer : left = ast_expr_unary(token, TK_Pointer, parse_expr(prefix_bp.right)); break;
case TK_Dereference: left = ast_expr_unary(token, TK_Dereference, parse_expr(prefix_bp.right)); break;
case TK_Sub : left = ast_expr_unary(token, TK_Sub, parse_expr(prefix_bp.right)); break;
case TK_Add : left = ast_expr_unary(token, TK_Add, parse_expr(prefix_bp.right)); break;
case TK_OpenBracket: {
Ast_Array *result = ast_array(token, parse_expr(0));