Testing big ints

This commit is contained in:
Krzosa Karol
2022-06-06 17:00:01 +02:00
parent dc56bd54f3
commit 7173557d26
5 changed files with 19 additions and 6 deletions

View File

@@ -68,7 +68,11 @@ function void
gen_value(Value a){
gen("%s", docname(a.type));
switch(a.type->kind){
CASE_INT: gen("%lld", bigint_as_signed(&a.big_int_val)); break;
CASE_INT: {
Scratch scratch;
const char *string = bigint_to_error_string(scratch, &a.big_int_val, 10);
gen("%s", string);
}break;
CASE_STRING: gen("LIT(\"%s\")", a.intern_val.str); break;
CASE_BOOL: a.bool_val ? gen("true"):gen("false"); break;
CASE_FLOAT: gen("%f", a.f64_val); break;