diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-06-23 14:02:12 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-06-23 14:02:12 -0700 |
commit | dbe124108b7a3529feeeba91339928c4ac737072 (patch) | |
tree | 6da7f748b04ec70cf5f778863ae4f86403943eb2 /html/011load.cc.html | |
parent | fedebaf5dbc1b39347ad3e3a1580fa0190c320b6 (diff) | |
download | mu-dbe124108b7a3529feeeba91339928c4ac737072.tar.gz |
1631 - update html versions
Html is a little more readable thanks to feedback from J David Eisenberg (https://news.ycombinator.com/item?id=9766330), in particular the suggestion to use https://addons.mozilla.org/En-us/firefox/addon/wcag-contrast-checker.
Diffstat (limited to 'html/011load.cc.html')
-rw-r--r-- | html/011load.cc.html | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/html/011load.cc.html b/html/011load.cc.html index 547e81ce..fe74ef6e 100644 --- a/html/011load.cc.html +++ b/html/011load.cc.html @@ -12,15 +12,15 @@ <!-- pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } -* { font-size: 1em; } +* { font-size: 1.05em; } .traceContains { color: #008000; } .cSpecial { color: #008000; } -.Constant { color: #008080; } -.Comment { color: #8080ff; } -.Delimiter { color: #c000c0; } +.Constant { color: #00a0a0; } +.Comment { color: #9090ff; } +.Delimiter { color: #a04060; } .Special { color: #ff6060; } .Identifier { color: #804000; } -.CommentedCode { color: #6c6c6c; } +.Comment { color: #9090ff; } --> </style> @@ -51,14 +51,17 @@ vector<recipe_number> load<span class="Delimiter">(</span>string form<span <span class="Delimiter">}</span> vector<recipe_number> load<span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> + in >> std::noskipws<span class="Delimiter">;</span> vector<recipe_number> result<span class="Delimiter">;</span> while <span class="Delimiter">(</span>!in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Delimiter">{</span> +<span class="CommentedCode">//? cerr << "===\n"; //? 1</span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> if <span class="Delimiter">(</span>in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Identifier">break</span><span class="Delimiter">;</span> string command = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Comment">// Command Handlers</span> if <span class="Delimiter">(</span>command == <span class="Constant">"recipe"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> string recipe_name = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span class="CommentedCode">//? cerr << "recipe: " << recipe_name << '\n'; //? 1</span> if <span class="Delimiter">(</span>recipe_name<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> raise << <span class="Constant">"empty recipe name</span><span class="cSpecial">\n</span><span class="Constant">"</span><span class="Delimiter">;</span> if <span class="Delimiter">(</span>Recipe_number<span class="Delimiter">.</span>find<span class="Delimiter">(</span>recipe_name<span class="Delimiter">)</span> == Recipe_number<span class="Delimiter">.</span>end<span class="Delimiter">())</span> <span class="Delimiter">{</span> @@ -94,12 +97,14 @@ recipe slurp_recipe<span class="Delimiter">(</span>istream& in<span class="D instruction curr<span class="Delimiter">;</span> while <span class="Delimiter">(</span>next_instruction<span class="Delimiter">(</span>in<span class="Delimiter">,</span> &curr<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// End Rewrite Instruction(curr)</span> +<span class="CommentedCode">//? cerr << "instruction: " << curr.to_string() << '\n'; //? 2</span> result<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>curr<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Delimiter">}</span> bool next_instruction<span class="Delimiter">(</span>istream& in<span class="Delimiter">,</span> instruction* curr<span class="Delimiter">)</span> <span class="Delimiter">{</span> + in >> std::noskipws<span class="Delimiter">;</span> curr<span class="Delimiter">-></span>clear<span class="Delimiter">();</span> if <span class="Delimiter">(</span>in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="CommentedCode">//? show_rest_of_stream(in); //? 1</span> @@ -113,6 +118,7 @@ bool next_instruction<span class="Delimiter">(</span>istream& in<span class= skip_whitespace<span class="Delimiter">(</span>in<span class="Delimiter">);</span> if <span class="Delimiter">(</span>in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="CommentedCode">//? show_rest_of_stream(in); //? 1</span> string word = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> if <span class="Delimiter">(</span>in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> +<span class="CommentedCode">//? cerr << "AAA: " << word << '\n'; //? 1</span> words<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>word<span class="Delimiter">);</span> skip_whitespace<span class="Delimiter">(</span>in<span class="Delimiter">);</span> if <span class="Delimiter">(</span>in<span class="Delimiter">.</span>eof<span class="Delimiter">())</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> @@ -136,6 +142,7 @@ bool next_instruction<span class="Delimiter">(</span>istream& in<span class= for <span class="Delimiter">(;</span> *p != <span class="Constant">"<-"</span><span class="Delimiter">;</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>*p == <span class="Constant">","</span><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> curr<span class="Delimiter">-></span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> +<span class="CommentedCode">//? cerr << "product: " << curr->products.back().to_string() << '\n'; //? 1</span> <span class="Delimiter">}</span> ++p<span class="Delimiter">;</span> <span class="Comment">// skip <-</span> <span class="Delimiter">}</span> @@ -153,6 +160,7 @@ bool next_instruction<span class="Delimiter">(</span>istream& in<span class= for <span class="Delimiter">(;</span> p != words<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> if <span class="Delimiter">(</span>*p == <span class="Constant">","</span><span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> curr<span class="Delimiter">-></span>ingredients<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> +<span class="CommentedCode">//? cerr << "ingredient: " << curr->ingredients.back().to_string() << '\n'; //? 1</span> <span class="Delimiter">}</span> trace<span class="Delimiter">(</span><span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"instruction: "</span> << curr<span class="Delimiter">-></span>name<span class="Delimiter">;</span> @@ -172,6 +180,7 @@ string next_word<span class="Delimiter">(</span>istream& in<span class="Deli slurp_word<span class="Delimiter">(</span>in<span class="Delimiter">,</span> out<span class="Delimiter">);</span> skip_whitespace<span class="Delimiter">(</span>in<span class="Delimiter">);</span> skip_comment<span class="Delimiter">(</span>in<span class="Delimiter">);</span> +<span class="CommentedCode">//? cerr << '^' << out.str() << "$\n"; //? 1</span> <span class="Identifier">return</span> out<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span class="Delimiter">}</span> |