shithub: rgbds

Download patch

ref: 363b3d01341f3511b9316a78c7686e15901e5d66
parent: c7ed9a275e793e9f6509cc6e900cb5d1c659c6b1
author: Rangi <[email protected]>
date: Wed Mar 31 07:22:41 EDT 2021

Flush stdout after PRINTLN

This allows debug PRINTLN statements to run even if
subsequent rgbasm directives cause a crash.

--- a/src/asm/parser.y
+++ b/src/asm/parser.y
@@ -1164,8 +1164,14 @@
 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