From 83fcebf3210b638d9f8248e0007e9f0c9804980a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 13 Jul 2015 20:53:41 -0700 Subject: 1778 --- html/027trace.cc.html | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 html/027trace.cc.html (limited to 'html/027trace.cc.html') diff --git a/html/027trace.cc.html b/html/027trace.cc.html new file mode 100644 index 00000000..a0823ce3 --- /dev/null +++ b/html/027trace.cc.html @@ -0,0 +1,66 @@ + + + + +Mu - 027trace.cc + + + + + + + + + + +
+//: Allow mu programs to log facts just like we've been doing in C++ so far.
+
+:(scenario trace)
+recipe main [
+  trace [foo], [this is a trace in mu]
+]
++foo: this is a trace in mu
+
+:(before "End Primitive Recipe Declarations")
+TRACE,
+:(before "End Primitive Recipe Numbers")
+Recipe_ordinal["trace"] = TRACE;
+:(before "End Primitive Recipe Implementations")
+case TRACE: {
+  assert(is_literal(current_instruction().ingredients.at(0)));
+  string label = current_instruction().ingredients.at(0).name;
+  assert(is_literal(current_instruction().ingredients.at(1)));
+  string message = current_instruction().ingredients.at(1).name;
+  trace(1, label) << message;
+  break;
+}
+
+:(before "End Primitive Recipe Declarations")
+HIDE_WARNINGS,
+:(before "End Primitive Recipe Numbers")
+Recipe_ordinal["hide-warnings"] = HIDE_WARNINGS;
+:(before "End Primitive Recipe Implementations")
+case HIDE_WARNINGS: {
+  Hide_warnings = true;
+  break;
+}
+
+ + + -- cgit 1.4.1-2-gfad0