diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-22 04:04:46 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-22 04:04:46 -0700 |
commit | beea7ce25cfe42c363259705a6b5741ad47484ab (patch) | |
tree | d30b44a935bad1cb6c88083c57caabdf062ed513 /html/053recipe_header.cc.html | |
parent | 98e3a41bf96b37d94f6b0a0e98a4635a174e9903 (diff) | |
download | mu-beea7ce25cfe42c363259705a6b5741ad47484ab.tar.gz |
3543
Diffstat (limited to 'html/053recipe_header.cc.html')
-rw-r--r-- | html/053recipe_header.cc.html | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/html/053recipe_header.cc.html b/html/053recipe_header.cc.html index 5e9a957c..cce0a02f 100644 --- a/html/053recipe_header.cc.html +++ b/html/053recipe_header.cc.html @@ -21,7 +21,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color .Comment { color: #9090ff; } .Delimiter { color: #800080; } .Special { color: #c00000; } -.Identifier { color: #fcb165; } +.Identifier { color: #ecf32c; } .Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Error { color: #ffffff; background-color: #ff6060; padding-bottom: 1px; } .SalientComment { color: #00ffff; } @@ -71,6 +71,11 @@ has_header = <span class="Constant">false</span><span class="Delimiter">;</span> result<span class="Delimiter">.</span>has_header = <span class="Constant">true</span><span class="Delimiter">;</span> <span class="Normal">while</span> <span class="Delimiter">(</span>has_data<span class="Delimiter">(</span>in<span class="Delimiter">)</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="Constant">'['</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> string s = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>s<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> + assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> + raise << <span class="Constant">"incomplete recipe header at end of file (0)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> + <span class="Identifier">return</span><span class="Delimiter">;</span> + <span class="Delimiter">}</span> <span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">"<-"</span><span class="Delimiter">)</span> raise << <span class="Constant">"recipe "</span> << result<span class="Delimiter">.</span>name << <span class="Constant">" should say '->' and not '<-'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Normal">if</span> <span class="Delimiter">(</span>s == <span class="Constant">"->"</span><span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -80,6 +85,11 @@ has_header = <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> <span class="Normal">while</span> <span class="Delimiter">(</span>has_data<span class="Delimiter">(</span>in<span class="Delimiter">)</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="Constant">'['</span> && in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> != <span class="cSpecial">'\n'</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> string s = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>s<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> + assert<span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">));</span> + raise << <span class="Constant">"incomplete recipe header at end of file (1)</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> + <span class="Identifier">return</span><span class="Delimiter">;</span> + <span class="Delimiter">}</span> result<span class="Delimiter">.</span>products<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>reagent<span class="Delimiter">(</span>s<span class="Delimiter">));</span> trace<span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"parse"</span><span class="Delimiter">)</span> << <span class="Constant">"header product: "</span> << result<span class="Delimiter">.</span>products<span class="Delimiter">.</span>back<span class="Delimiter">().</span>original_string << end<span class="Delimiter">();</span> skip_whitespace_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> @@ -242,9 +252,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Normal">else</span> <span class="Delimiter">{</span> products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">2</span><span class="Delimiter">);</span> <span class="Comment">// pad the first product with sufficient zeros to match its type</span> - <span class="Normal">int</span> size = size_of<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> - <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < size<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> - products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> + products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>resize<span class="Delimiter">(</span>size_of<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)));</span> products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Identifier">break</span><span class="Delimiter">;</span> |