about summary refs log tree commit diff stats
path: root/056recipe_header.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-29 11:15:13 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-29 11:15:13 -0700
commitb2ec0969e9f7ef7c3267545efbed907c15084695 (patch)
treea7104a5daf769414a90aec52da93e57507c5fba5 /056recipe_header.cc
parente330f8545533d03bfe1a29506f243d4846dbd7c2 (diff)
downloadmu-b2ec0969e9f7ef7c3267545efbed907c15084695.tar.gz
2310 - add some more tracing
I've been growing lax on white-box testing when it's one of the three
big thrusts of this whole effort. Perhaps it was because I got too
obsessed with keeping traces stable and didn't notice that stable
doesn't mean "not changing". Or perhaps it's because I still don't have
a zoomable trace browser that can parse traces from disk. Or perhaps
$trace-browser is too clunky and discourages me from using it.
Regardless, I need to make the trace useable again before I work much
more on the next few rewriting transforms.
Diffstat (limited to '056recipe_header.cc')
-rw-r--r--056recipe_header.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/056recipe_header.cc b/056recipe_header.cc
index d00b0a2e..38c7b204 100644
--- a/056recipe_header.cc
+++ b/056recipe_header.cc
@@ -22,6 +22,7 @@ vector<reagent> products;
 :(before "slurp_body(in, result);" following "long long int slurp_recipe(istream& in)")
 skip_whitespace(in);
 if (in.peek() != '[') {
+  trace(9999, "parse") << "recipe has a header; parsing";
   load_recipe_header(in, result);
 }
 
@@ -31,11 +32,13 @@ void load_recipe_header(istream& in, recipe& result) {
     string s = next_word(in);
     if (s == "->") break;
     result.ingredients.push_back(reagent(s));
+    trace(9999, "parse") << "header ingredient: " << result.ingredients.back().original_string << end();
     skip_whitespace(in);
   }
   while (in.peek() != '[') {
     string s = next_word(in);
     result.products.push_back(reagent(s));
+    trace(9999, "parse") << "header product: " << result.products.back().original_string << end();
     skip_whitespace(in);
   }
 }
@@ -73,6 +76,7 @@ recipe add2 x:number, y:number -> z:number [
 void check_header_products(const recipe_ordinal r) {
   const recipe& rr = Recipe[r];
   if (rr.products.empty()) return;
+  trace("transform") << "checking reply instructions against header for " << rr.name << end();
   for (long long int i = 0; i < SIZE(rr.steps); ++i) {
     const instruction& inst = rr.steps.at(i);
     if (inst.operation != REPLY) continue;