diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-08 02:29:01 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-02-08 02:29:01 +0330 |
commit | 1e7c135d12474333871ae263afde42e6bcb7dd6b (patch) | |
tree | 615f74ef8070fab8cff555ed164f0191f2739f73 | |
parent | 1460877dca47ab740eef3a5529cd30008e1a27a5 (diff) |
clean up
-rw-r--r-- | src/compiler/ast-tree.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c index f5867cc..52447e3 100644 --- a/src/compiler/ast-tree.c +++ b/src/compiler/ast-tree.c @@ -1031,15 +1031,9 @@ AstTree *makeTypeOf(AstTree *value) { AstTreeVariable *variable = value->metadata; return copyAstTree(variable->type); } - case AST_TREE_TOKEN_OPERATOR_ASSIGN: { - AstTreeInfix *metadata = value->metadata; - return copyAstTree(metadata->left.type); - } + case AST_TREE_TOKEN_OPERATOR_ASSIGN: case AST_TREE_TOKEN_OPERATOR_SUM: { AstTreeInfix *metadata = value->metadata; - - // TODO: find a better way - return copyAstTree(metadata->left.type); } case AST_TREE_TOKEN_VARIABLE_DEFINE: @@ -1260,7 +1254,7 @@ bool setTypesOperatorAssign(AstTree *tree) { } else if (!typeIsEqual(infix->left.type, infix->right.type)) { printLog("Type mismatch"); return false; - } else if(isConst(&infix->left)){ + } else if (isConst(&infix->left)) { printLog("Constants can't be assigned"); return false; } else { |