diff options
Diffstat (limited to '010vm.cc')
-rw-r--r-- | 010vm.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc index 528436c6..2dddf9ee 100644 --- a/010vm.cc +++ b/010vm.cc @@ -603,6 +603,20 @@ string to_string(const recipe& r) { return out.str(); } +string to_original_string(const recipe& r) { + ostringstream out; + out << "recipe " << r.name << " [\n"; + for (int i = 0; i < SIZE(r.steps); ++i) { + const instruction& inst = r.steps.at(i); + if (inst.original_string.empty()) + out << " " << to_original_string(r.steps.at(i)) << '\n'; + else + out << " " << r.steps.at(i).original_string << '\n'; + } + out << "]\n"; + return out.str(); +} + string debug_string(const recipe& x) { ostringstream out; out << "- recipe " << x.name << '\n'; |