aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-08-23 11:51:04 +0100
committergingerBill <bill@gingerbill.org>2019-08-23 11:51:04 +0100
commitcf23954297993b3e574c295f95f75b294fdca4ec (patch)
treee37561a4e46243ce4985cf53c77e02da54c4dc7d /src/check_expr.cpp
parentd1cc6534cdb25c95f948a81e863f9348dfb5122e (diff)
Improve #assert to show the procedure and signature it was called with; Allow the ability to print ExactValue correct now.
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 6c252b9b6..24a130d62 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -3360,6 +3360,11 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
if (!operand->value.value_bool) {
gbString arg = expr_to_string(ce->args[0]);
error(call, "Compile time assertion: %s", arg);
+ if (c->proc_name != "") {
+ gbString str = type_to_string(c->curr_proc_sig);
+ error_line("\tCalled within '%.*s' :: %s\n", LIT(c->proc_name), str);
+ gb_string_free(str);
+ }
gb_string_free(arg);
}
@@ -3744,7 +3749,9 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
}
if (x.mode == Addressing_Constant && y.mode == Addressing_Constant) {
- operand->value = exact_binary_operator_value(Token_Add, x.value, y.value);
+ f64 r = exact_value_to_float(x.value).value_float;
+ f64 i = exact_value_to_float(y.value).value_float;
+ operand->value = exact_value_complex(r, i);
operand->mode = Addressing_Constant;
} else {
operand->mode = Addressing_Value;