diff options
Diffstat (limited to '027debug.cc')
-rw-r--r-- | 027debug.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/027debug.cc b/027debug.cc index 27ac8ce6..c4d39104 100644 --- a/027debug.cc +++ b/027debug.cc @@ -6,16 +6,18 @@ _PRINT, Recipe_number["$print"] = _PRINT; :(before "End Primitive Recipe Implementations") case _PRINT: { - if (isa_literal(current_instruction().ingredients[0])) { - trace("run") << "$print: " << current_instruction().ingredients[0].name; - cout << current_instruction().ingredients[0].name; - break; - } - vector<long long int> result(read_memory(current_instruction().ingredients[0])); - for (index_t i = 0; i < result.size(); ++i) { - trace("run") << "$print: " << result[i]; - if (i > 0) cout << " "; - cout << result[i]; + for (index_t i = 0; i < ingredients.size(); ++i) { + if (isa_literal(current_instruction().ingredients.at(i))) { + trace("run") << "$print: " << current_instruction().ingredients.at(i).name; + cout << current_instruction().ingredients.at(i).name; + } + else { + for (index_t j = 0; j < ingredients.at(i).size(); ++j) { + trace("run") << "$print: " << ingredients.at(i).at(j); + if (j > 0) cout << " "; + cout << ingredients.at(i).at(j); + } + } } break; } |