about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cpp/.traces/trace7
-rw-r--r--cpp/032trace21
2 files changed, 28 insertions, 0 deletions
diff --git a/cpp/.traces/trace b/cpp/.traces/trace
new file mode 100644
index 00000000..fb4fd081
--- /dev/null
+++ b/cpp/.traces/trace
@@ -0,0 +1,7 @@
+parse/0: instruction: 32
+parse/0:   ingredient: {name: "foo", value: 0, type: 0, properties: ["foo": "literal-string"]}
+parse/0:   ingredient: {name: "this is a trace in mu", value: 0, type: 0, properties: ["this is a trace in mu": "literal-string"]}
+after-brace/0: recipe main
+after-brace/0: trace ...
+run/0: instruction main/0
+foo/0: this is a trace in mu
diff --git a/cpp/032trace b/cpp/032trace
new file mode 100644
index 00000000..3a7b0b0e
--- /dev/null
+++ b/cpp/032trace
@@ -0,0 +1,21 @@
+:(scenario "trace")
+recipe main [
+  trace [foo], [this is a trace in mu]
+]
++foo: this is a trace in mu
+
+:(before "End Globals")
+const int TRACE = 32;
+:(before "End Primitive Recipe Numbers")
+Recipe_number["trace"] = TRACE;
+assert(Next_recipe_number == TRACE);
+Next_recipe_number++;
+:(before "End Primitive Recipe Implementations")
+case TRACE: {
+  assert(isa_literal(instructions[pc].ingredients[0]));
+  string label = instructions[pc].ingredients[0].name;
+  assert(isa_literal(instructions[pc].ingredients[1]));
+  string message = instructions[pc].ingredients[1].name;
+  trace(label) << message;
+  break;
+}
018-12-01 14:13:33 -0800 4814' href='/akkartik/mu/commit/update_html?h=hlt&id=e4ac3c9e6e5464a0fc0f8fd3763a572e0e180c04'>e4ac3c9e ^
ba6621b5 ^
e5c11a51 ^
f5465e12 ^
cdf28227 ^
f5465e12 ^
e4ac3c9e ^


2564eb6f ^

f5465e12 ^
08a0eed6 ^

ccae4585 ^





f5465e12 ^


6e1eeeeb ^
a220427e ^

5008a4ec ^
a220427e ^


6e1eeeeb ^
a220427e ^
5008a4ec ^
6e1eeeeb ^
08a0eed6 ^




6e1eeeeb ^

08a0eed6 ^
5008a4ec ^
08a0eed6 ^


6e1eeeeb ^
a220427e ^
5008a4ec ^
6e1eeeeb ^
a220427e ^




c762564b ^
9a7e1a0f ^
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