Skip to content

Commit bfef478

Browse files
gh-100: PRINT renders BOOL.
1 parent 8090c0e commit bfef478

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/builtins.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5374,6 +5374,10 @@ static Value builtin_print(Interpreter* interp, Value* args, int argc, Expr** ar
53745374

53755375
for (int i = 0; i < argc; i++) {
53765376
switch (args[i].type) {
5377+
case VAL_BOOL: {
5378+
if (forward) printf("%s", args[i].as.boolean ? "TRUE" : "FALSE");
5379+
break;
5380+
}
53775381
case VAL_INT: {
53785382
char* s = int_to_base_prefixed_str(args[i].as.i, numeric_base_of(args[i]));
53795383
if (forward) printf("%s", s);
@@ -5411,6 +5415,10 @@ static Value builtin_warn(Interpreter* interp, Value* args, int argc, Expr** arg
54115415
printf("WARNING: ");
54125416
for (int i = 0; i < argc; i++) {
54135417
switch (args[i].type) {
5418+
case VAL_BOOL: {
5419+
printf("%s", args[i].as.boolean ? "TRUE" : "FALSE");
5420+
break;
5421+
}
54145422
case VAL_INT: {
54155423
char* s = int_to_base_prefixed_str(args[i].as.i, numeric_base_of(args[i]));
54165424
printf("%s", s);

0 commit comments

Comments
 (0)