diff options
Diffstat (limited to 'html/072scenario_screen.cc.html')
-rw-r--r-- | html/072scenario_screen.cc.html | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/html/072scenario_screen.cc.html b/html/072scenario_screen.cc.html index e436cfe6..f5210f0b 100644 --- a/html/072scenario_screen.cc.html +++ b/html/072scenario_screen.cc.html @@ -16,6 +16,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } .traceContains { color: #008000; } .cSpecial { color: #008000; } .Constant { color: #00a0a0; } +.traceAbsent { color: #c00000; } .Comment { color: #9090ff; } .Delimiter { color: #a04060; } .Special { color: #ff6060; } @@ -141,6 +142,16 @@ scenario screen-in-scenario-color [ <span class="Delimiter">:(before "End is_special_name Cases")</span> if <span class="Delimiter">(</span>s == <span class="Constant">"screen"</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> +<span class="Delimiter">:(scenarios run)</span> +<span class="Delimiter">:(scenario convert_names_does_not_warn_when_mixing_special_names_and_numeric_locations)</span> +<span class="Special">% Hide_warnings = true;</span> +recipe main [ + screen:number<span class="Special"> <- </span>copy <span class="Constant">1</span>:number +] +<span class="traceAbsent">-warn: mixing variable names and numeric addresses in main</span> +$warn: <span class="Constant">0</span> +<span class="Delimiter">:(scenarios run_mu_scenario)</span> + <span class="Delimiter">:(before "End Globals")</span> <span class="Comment">// Scenarios may not define default-space, so they should fit within the</span> <span class="Comment">// initial area of memory reserved for tests. We'll put the predefined</span> @@ -159,8 +170,8 @@ assert<span class="Delimiter">(</span>Name[tmp_recipe<span class="Delimiter">.</ <span class="Comment">// Scenario Globals.</span> const long long int SCREEN = Next_predefined_global_for_scenarios++<span class="Delimiter">;</span> <span class="Comment">// End Scenario Globals.</span> -<span class="Delimiter">:(before "End Predefined Scenario Locals In Run")</span> -Name[tmp_recipe<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>][<span class="Constant">"screen"</span>] = SCREEN<span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Special Scenario Variable Names(r)")</span> +Name[r][<span class="Constant">"screen"</span>] = SCREEN<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Rewrite Instruction(curr)")</span> <span class="Comment">// rewrite `assume-screen width, height` to</span> @@ -231,7 +242,9 @@ void check_screen<span class="Delimiter">(</span>const string& expected_cont raw_string_stream cursor<span class="Delimiter">(</span>expected_contents<span class="Delimiter">);</span> <span class="Comment">// todo: too-long expected_contents should fail</span> long long int addr = screen_data_start+<span class="Constant">1</span><span class="Delimiter">;</span> <span class="Comment">// skip length</span> +<span class="CommentedCode">//? cerr << "screen height " << screen_height << '\n'; //? 1</span> for <span class="Delimiter">(</span>long long int row = <span class="Constant">0</span><span class="Delimiter">;</span> row < screen_height<span class="Delimiter">;</span> ++row<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span class="CommentedCode">//? cerr << "row: " << row << '\n'; //? 1</span> cursor<span class="Delimiter">.</span>skip_whitespace_and_comments<span class="Delimiter">();</span> if <span class="Delimiter">(</span>cursor<span class="Delimiter">.</span>at_end<span class="Delimiter">())</span> <span class="Identifier">break</span><span class="Delimiter">;</span> assert<span class="Delimiter">(</span>cursor<span class="Delimiter">.</span>get<span class="Delimiter">()</span> == <span class="Constant">'.'</span><span class="Delimiter">);</span> @@ -299,6 +312,8 @@ void check_screen<span class="Delimiter">(</span>const string& expected_cont raw_string_stream::raw_string_stream<span class="Delimiter">(</span>const string& backing<span class="Delimiter">)</span> :index<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">),</span> max<span class="Delimiter">(</span>backing<span class="Delimiter">.</span>size<span class="Delimiter">()),</span> buf<span class="Delimiter">(</span>backing<span class="Delimiter">.</span>c_str<span class="Delimiter">())</span> <span class="Delimiter">{}</span> bool raw_string_stream::at_end<span class="Delimiter">()</span> const <span class="Delimiter">{</span> +<span class="CommentedCode">//? cerr << index << ' ' << max << '\n'; //? 1</span> +<span class="CommentedCode">//? cerr << buf << "$\n"; //? 1</span> if <span class="Delimiter">(</span>index >= max<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> if <span class="Delimiter">(</span>tb_utf8_char_length<span class="Delimiter">(</span>buf[index]<span class="Delimiter">)</span> > max-index<span class="Delimiter">)</span> <span class="Delimiter">{</span> raise << <span class="Constant">"unicode string seems corrupted at index "</span><< index << <span class="Constant">" character "</span> << static_cast<int><span class="Delimiter">(</span>buf[index]<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> @@ -363,6 +378,7 @@ void dump_screen<span class="Delimiter">()</span> <span class="Delimiter">{</spa long long int curr = screen_data_start+<span class="Constant">1</span><span class="Delimiter">;</span> <span class="Comment">// skip length</span> for <span class="Delimiter">(</span>long long int row = <span class="Constant">0</span><span class="Delimiter">;</span> row < screen_height<span class="Delimiter">;</span> ++row<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="CommentedCode">//? cerr << curr << ":\n"; //? 2</span> + cerr << <span class="Constant">'.'</span><span class="Delimiter">;</span> for <span class="Delimiter">(</span>long long int col = <span class="Constant">0</span><span class="Delimiter">;</span> col < screen_width<span class="Delimiter">;</span> ++col<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>Memory[curr]<span class="Delimiter">)</span> cerr << to_unicode<span class="Delimiter">(</span>Memory[curr]<span class="Delimiter">);</span> @@ -370,7 +386,7 @@ void dump_screen<span class="Delimiter">()</span> <span class="Delimiter">{</spa cerr << <span class="Constant">' '</span><span class="Delimiter">;</span> curr += <span class="Comment">/*</span><span class="Comment">size of screen-cell</span><span class="Comment">*/</span><span class="Constant">2</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - cerr << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> + cerr << <span class="Constant">".</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="Delimiter">}</span> </pre> |