From 762b099ef6c6ad5b6b61d29e473baa6df8d64ab9 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 18 Jul 2015 15:22:49 -0700 Subject: 1818 --- html/029debug.cc.html | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'html/029debug.cc.html') diff --git a/html/029debug.cc.html b/html/029debug.cc.html index 85f82582..58adec43 100644 --- a/html/029debug.cc.html +++ b/html/029debug.cc.html @@ -13,6 +13,7 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } +.cSpecial { color: #008000; } .Constant { color: #00a0a0; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } @@ -40,7 +41,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) { @@ -134,6 +138,36 @@ case _DUMP_MEMORY: { dump_memory(); break; } + +:(before "End Primitive Recipe Declarations") +_DUMP, +:(before "End Primitive Recipe Numbers") +Recipe_ordinal["$dump"] = _DUMP; +:(before "End Primitive Recipe Implementations") +case _DUMP: { + reagent after_canonize = canonize(current_instruction().ingredients.at(0)); + cerr << current_recipe_name() << ": " << current_instruction().ingredients.at(0).name << ' ' << current_instruction().ingredients.at(0).value << " => " << after_canonize.value << " => " << Memory[after_canonize.value] << '\n'; + break; +} + +//: Helper for debugging: grab an address and then dump its value. +:(before "End Globals") +long long int foo = -1; +:(before "End Primitive Recipe Declarations") +_FOO, +:(before "End Primitive Recipe Numbers") +Recipe_ordinal["$foo"] = _FOO; +:(before "End Primitive Recipe Implementations") +case _FOO: { + if (current_instruction().ingredients.empty()) { + if (foo != -1) cerr << foo << ": " << Memory[foo] << '\n'; + else cerr << '\n'; + } + else { + foo = canonize(current_instruction().ingredients.at(0)).value; + } + break; +} -- cgit 1.4.1-2-gfad0