From d2bd40bfcb995fecb947035b0c896342ca22cdd6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 15 Nov 2015 12:47:48 -0800 Subject: 2447 --- html/010vm.cc.html | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'html/010vm.cc.html') diff --git a/html/010vm.cc.html b/html/010vm.cc.html index 20c502ba..f476aa61 100644 --- a/html/010vm.cc.html +++ b/html/010vm.cc.html @@ -467,11 +467,11 @@ string instruction::to_string() const (const recipe& x) { ostringstream out; - out << "recipe " << x.name << '\n'; + out << "- recipe " << x.name << '\n'; // Begin debug_string(recipe x) for (long long int index = 0; index < SIZE(x.steps); ++index) { const instruction& inst = x.steps.at(index); - out << " inst: " << inst.to_string() << '\n'; + out << "inst: " << inst.to_string() << '\n'; out << " ingredients\n"; for (long long int i = 0; i < SIZE(inst.ingredients); ++i) out << " " << debug_string(inst.ingredients.at(i)) << '\n'; @@ -518,6 +518,23 @@ bool deeply_equal(const string_tree* a(a->right, b->right); } +:(before "End Globals") +set<string> Literal_type_names; +:(before "End One-time Setup") +Literal_type_names.insert("literal"); +Literal_type_names.insert("number"); +Literal_type_names.insert("character"); +:(code) +bool deeply_equal_types(const string_tree* a, const string_tree* b) { + if (!a) return !b; + if (!b) return !a; + if (Literal_type_names.find(a->value) != Literal_type_names.end()) + return Literal_type_names.find(b->value) != Literal_type_names.end(); + return a->value == b->value + && deeply_equal_types(a->left, b->left) + && deeply_equal_types(a->right, b->right); +} + void dump_memory() { for (map<long long int, double>::iterator p = Memory.begin(); p != Memory.end(); ++p) { cout << p->first << ": " << no_scientific(p->second) << '\n'; -- cgit 1.4.1-2-gfad0