From b75300444bd320a45d1366b093177c538d35c0a6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Jul 2015 18:51:14 -0700 Subject: 1808 - helper to print newlines during debugging The recent session makes me weary of deleting comment counts from inside strings, and the newlines everywhere take up vertical space. Considered println like pascal/ruby, but I'd like something I can add/remove at the end of existing prints. So this hack for $print. --- 029debug.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to '029debug.cc') diff --git a/029debug.cc b/029debug.cc index e185a314..753375cc 100644 --- a/029debug.cc +++ b/029debug.cc @@ -9,7 +9,10 @@ case _PRINT: { for (long long int i = 0; i < SIZE(ingredients); ++i) { if (is_literal(current_instruction().ingredients.at(i))) { trace(Primitive_recipe_depth, "run") << "$print: " << current_instruction().ingredients.at(i).name; - cout << current_instruction().ingredients.at(i).name; + if (has_property(current_instruction().ingredients.at(i), "newline")) + cout << '\n'; + else + cout << current_instruction().ingredients.at(i).name; } else { for (long long int j = 0; j < SIZE(ingredients.at(i)); ++j) { -- cgit 1.4.1-2-gfad0