From b2ec0969e9f7ef7c3267545efbed907c15084695 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 29 Oct 2015 11:15:13 -0700 Subject: 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. --- 011load.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '011load.cc') diff --git a/011load.cc b/011load.cc index 3e1766f9..db97f3b0 100644 --- a/011load.cc +++ b/011load.cc @@ -47,7 +47,9 @@ long long int slurp_recipe(istream& in) { if (Recipe_ordinal.find(recipe_name) == Recipe_ordinal.end()) { Recipe_ordinal[recipe_name] = Next_recipe_ordinal++; } + trace(9991, "load") << "--- defining " << recipe_name << end(); if (Recipe.find(Recipe_ordinal[recipe_name]) != Recipe.end()) { + trace(9991, "parse") << "already exists" << end(); if (warn_on_redefine(recipe_name)) raise << "redefining recipe " << Recipe[Recipe_ordinal[recipe_name]].name << "\n" << end(); Recipe.erase(Recipe_ordinal[recipe_name]); @@ -69,6 +71,7 @@ void slurp_body(istream& in, recipe& result) { instruction curr; while (next_instruction(in, &curr)) { // End Rewrite Instruction(curr, recipe result) + trace(9992, "load") << "after rewriting: " << curr.to_string() << end(); if (!curr.is_clear()) result.steps.push_back(curr); } @@ -110,7 +113,7 @@ bool next_instruction(istream& in, instruction* curr) { if (SIZE(words) == 1 && !isalnum(words.at(0).at(0)) && words.at(0).at(0) != '$') { curr->is_label = true; curr->label = words.at(0); - trace("parse") << "label: " << curr->label << end(); + trace(9993, "parse") << "label: " << curr->label << end(); if (in.eof()) { raise_error << "7: unbalanced '[' for recipe\n" << end(); return false; @@ -144,12 +147,12 @@ bool next_instruction(istream& in, instruction* curr) { curr->ingredients.push_back(reagent(*p)); } - trace("parse") << "instruction: " << curr->name << end(); + trace(9993, "parse") << "instruction: " << curr->name << end(); for (vector::iterator p = curr->ingredients.begin(); p != curr->ingredients.end(); ++p) { - trace("parse") << " ingredient: " << p->to_string() << end(); + trace(9993, "parse") << " ingredient: " << p->to_string() << end(); } for (vector::iterator p = curr->products.begin(); p != curr->products.end(); ++p) { - trace("parse") << " product: " << p->to_string() << end(); + trace(9993, "parse") << " product: " << p->to_string() << end(); } if (in.eof()) { raise_error << "9: unbalanced '[' for recipe\n" << end(); -- cgit 1.4.1-2-gfad0 71b79225a7'>plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109