aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-01 20:59:14 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-01 20:59:14 +0000
commit205f4664f8da99d530ef6c1d13419859f3b4ed86 (patch)
treee42b1294ff21c3b1072cb039a7c454ca808e90d5 /src/check_expr.c
parentc6133587d1bdf7ae723beb8c3a3b27b472bf2d7a (diff)
Update code from OSX merge to be consistent with the rest of the code
Remove some dead code whilst I was here too :P
Diffstat (limited to 'src/check_expr.c')
-rw-r--r--src/check_expr.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/check_expr.c b/src/check_expr.c
index 6b09c3a82..21e357c9d 100644
--- a/src/check_expr.c
+++ b/src/check_expr.c
@@ -225,9 +225,6 @@ i64 check_distance_between_types(Checker *c, Operand *operand, Type *type) {
return -1;
}
-#ifndef _MAX
-#define _MAX(x, y) ((x) > (y) ? (x) : (y))
-#endif
bool check_is_assignable_to_with_score(Checker *c, Operand *operand, Type *type, i64 *score_) {
i64 score = 0;
@@ -235,8 +232,7 @@ bool check_is_assignable_to_with_score(Checker *c, Operand *operand, Type *type,
bool ok = distance >= 0;
if (ok) {
// TODO(bill): A decent score function
- // score = max(1000000 - distance*distance, 0);
- score = _MAX(1000000 - distance*distance, 0);
+ score = gb_max(1000000 - distance*distance, 0);
}
if (score_) *score_ = score;
return ok;
@@ -1008,10 +1004,6 @@ void check_identifier(Checker *c, Operand *o, AstNode *n, Type *named_type, Type
o->mode = Addressing_Value;
break;
- case Entity_ImplicitValue:
- o->mode = Addressing_Value;
- break;
-
default:
compiler_error("Compiler error: Unknown EntityKind");
break;
@@ -2567,9 +2559,6 @@ Entity *check_selector(Checker *c, Operand *operand, AstNode *node, Type *type_h
case Entity_Nil:
operand->mode = Addressing_Value;
break;
- case Entity_ImplicitValue:
- operand->mode = Addressing_Value;
- break;
}
operand->type = entity->type;
@@ -5105,6 +5094,10 @@ gbString write_expr_to_string(gbString str, AstNode *node) {
str = string_append_token(str, *i);
case_end;
+ case_ast_node(i, Implicit, node);
+ str = string_append_token(str, *i);
+ case_end;
+
case_ast_node(bl, BasicLit, node);
str = string_append_token(str, *bl);
case_end;