diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-17 18:51:14 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-17 18:51:14 -0700 |
commit | b75300444bd320a45d1366b093177c538d35c0a6 (patch) | |
tree | 862a44688e412ebcd74281f0fa867e387e09015d /029debug.cc | |
parent | e52972cb0aaa749e901b518c0b594dd14d687fa6 (diff) | |
download | mu-b75300444bd320a45d1366b093177c538d35c0a6.tar.gz |
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.
Diffstat (limited to '029debug.cc')
-rw-r--r-- | 029debug.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |