diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-25 22:15:51 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-25 22:15:51 -0700 |
commit | 9542bb112419d575190a72baf7f964c3e32df223 (patch) | |
tree | f9edd69ee91c47d41d50dc1f86ae86dcf10e4428 /html/027trace.cc.html | |
parent | 955a66a504aec3f106b415d271403b63d0d0e410 (diff) | |
download | mu-9542bb112419d575190a72baf7f964c3e32df223.tar.gz |
1853
Diffstat (limited to 'html/027trace.cc.html')
-rw-r--r-- | html/027trace.cc.html | 66 |
1 files changed, 61 insertions, 5 deletions
diff --git a/html/027trace.cc.html b/html/027trace.cc.html index a0823ce3..1be9cffe 100644 --- a/html/027trace.cc.html +++ b/html/027trace.cc.html @@ -13,11 +13,14 @@ 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; } -.traceContains { color: #008000; } +.cSpecial { color: #008000; } .Constant { color: #00a0a0; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } +.CommentedCode { color: #6c6c6c; } .Identifier { color: #804000; } +.traceContains { color: #008000; } --> </style> @@ -33,7 +36,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Delimiter">:(scenario trace)</span> recipe main [ - trace [foo]<span class="Delimiter">,</span> [this is a trace in mu] + trace [foo]<span class="Delimiter">,</span> [<span class="Normal">this</span> is a trace in mu] ] <span class="traceContains">+foo: this is a trace in mu</span> @@ -42,12 +45,16 @@ TRACE<span class="Delimiter">,</span> <span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> Recipe_ordinal[<span class="Constant">"trace"</span>] = TRACE<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case TRACE: <span class="Delimiter">{</span> +<span class="Normal">case</span> TRACE: <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>SIZE<span class="Delimiter">(</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> + raise << current_recipe_name<span class="Delimiter">()</span> << <span class="Constant">": 'trace' takes exactly two ingredients rather than '"</span> << current_instruction<span class="Delimiter">().</span>to_string<span class="Delimiter">()</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> + <span class="Identifier">break</span><span class="Delimiter">;</span> + <span class="Delimiter">}</span> assert<span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)));</span> string label = current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> assert<span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">)));</span> string message = current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> - trace<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">,</span> label<span class="Delimiter">)</span> << message<span class="Delimiter">;</span> + trace<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">,</span> label<span class="Delimiter">)</span> << message << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -56,10 +63,59 @@ HIDE_WARNINGS<span class="Delimiter">,</span> <span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> Recipe_ordinal[<span class="Constant">"hide-warnings"</span>] = HIDE_WARNINGS<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case HIDE_WARNINGS: <span class="Delimiter">{</span> +<span class="Normal">case</span> HIDE_WARNINGS: <span class="Delimiter">{</span> Hide_warnings = <span class="Constant">true</span><span class="Delimiter">;</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> + +<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> +SHOW_WARNINGS<span class="Delimiter">,</span> +<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> +Recipe_ordinal[<span class="Constant">"show-warnings"</span>] = SHOW_WARNINGS<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> +<span class="Normal">case</span> SHOW_WARNINGS: <span class="Delimiter">{</span> + Hide_warnings = <span class="Constant">false</span><span class="Delimiter">;</span> + <span class="Identifier">break</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + +<span class="Comment">//: helpers for debugging</span> + +<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> +_START_TRACING<span class="Delimiter">,</span> +<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> +Recipe_ordinal[<span class="Constant">"$start-tracing"</span>] = _START_TRACING<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> +<span class="Normal">case</span> _START_TRACING: <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> + Trace_stream<span class="Delimiter">-></span>dump_layer = <span class="Constant">"all"</span><span class="Delimiter">;</span> + <span class="Normal">else</span> + Trace_stream<span class="Delimiter">-></span>dump_layer = current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> +<span class="CommentedCode">//? cout << Trace_stream << ": " << Trace_stream->dump_layer << '\n'; //? 1</span> + <span class="Identifier">break</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + +<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> +_STOP_TRACING<span class="Delimiter">,</span> +<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> +Recipe_ordinal[<span class="Constant">"$stop-tracing"</span>] = _STOP_TRACING<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> +<span class="Normal">case</span> _STOP_TRACING: <span class="Delimiter">{</span> + Trace_stream<span class="Delimiter">-></span>dump_layer = <span class="Constant">""</span><span class="Delimiter">;</span> + <span class="Identifier">break</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + +<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> +_CLOSE_TRACE<span class="Delimiter">,</span> +<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> +Recipe_ordinal[<span class="Constant">"$close-trace"</span>] = _CLOSE_TRACE<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> +<span class="Normal">case</span> _CLOSE_TRACE: <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">delete</span> Trace_stream<span class="Delimiter">;</span> + Trace_stream = <span class="Constant">NULL</span><span class="Delimiter">;</span> + <span class="Delimiter">}</span> + <span class="Identifier">break</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> </pre> </body> </html> |