From 363b3d01341f3511b9316a78c7686e15901e5d66 Mon Sep 17 00:00:00 2001 From: Rangi Date: Wed, 31 Mar 2021 11:22:41 -0400 Subject: [PATCH] Flush stdout after PRINTLN This allows debug PRINTLN statements to run even if subsequent rgbasm directives cause a crash. --- src/asm/parser.y | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/asm/parser.y b/src/asm/parser.y index 5bd5e34f..74a40568 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -1164,8 +1164,14 @@ popc : T_POP_POPC { charmap_Pop(); } print : T_POP_PRINT print_exprs trailing_comma ; -println : T_POP_PRINTLN { putchar('\n'); } - | T_POP_PRINTLN print_exprs trailing_comma { putchar('\n'); } +println : T_POP_PRINTLN { + putchar('\n'); + fflush(stdout); + } + | T_POP_PRINTLN print_exprs trailing_comma { + putchar('\n'); + fflush(stdout); + } ; print_exprs : print_expr