diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-06 21:49:36 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-06 21:49:36 -0700 |
commit | eeed3845cd504028779c333665e0b9fad2070357 (patch) | |
tree | 3cc104aef7a43adfe4a143437f18064ad1a804d4 /html/089scenario_filesystem.cc.html | |
parent | 924253f1a5b8cdaa3ab301d752b9bdf855d6a0f9 (diff) | |
download | mu-eeed3845cd504028779c333665e0b9fad2070357.tar.gz |
3456
Diffstat (limited to 'html/089scenario_filesystem.cc.html')
-rw-r--r-- | html/089scenario_filesystem.cc.html | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/html/089scenario_filesystem.cc.html b/html/089scenario_filesystem.cc.html index 2f10c895..73232bdc 100644 --- a/html/089scenario_filesystem.cc.html +++ b/html/089scenario_filesystem.cc.html @@ -148,7 +148,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Identifier">break</span><span class="Delimiter">;</span> skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Identifier">break</span><span class="Delimiter">;</span> - string filename = next_filesystem_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> + string filename = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*filename<span class="Delimiter">.</span>begin<span class="Delimiter">()</span> != <span class="Constant">'['</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> raise << caller << <span class="Constant">": assume-filesystem: filename '"</span> << filename << <span class="Constant">"' must begin with a '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -163,7 +163,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span raise << caller << <span class="Constant">": assume-filesystem: no data for filename '"</span> << filename << <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> - string arrow = next_filesystem_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> + string arrow = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>arrow != <span class="Constant">"<-"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> raise << caller << <span class="Constant">": assume-filesystem: expected '<-' after filename '"</span> << filename << <span class="Constant">"' but got '"</span> << arrow << <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> @@ -172,7 +172,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span raise << caller << <span class="Constant">": assume-filesystem: no data for filename '"</span> << filename << <span class="Constant">"' after '<-'</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> - string contents = next_filesystem_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> + string contents = next_word<span class="Delimiter">(</span>in<span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*contents<span class="Delimiter">.</span>begin<span class="Delimiter">()</span> != <span class="Constant">'['</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> raise << caller << <span class="Constant">": assume-filesystem: file contents '"</span> << contents << <span class="Constant">"' for filename '"</span> << filename << <span class="Constant">"' must begin with a '['</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -264,19 +264,6 @@ string munge_filesystem_contents<span class="Delimiter">(</span><span class="Nor <span class="Identifier">return</span> result<span class="Delimiter">;</span> <span class="Delimiter">}</span> -string next_filesystem_word<span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> - skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> - <span class="Normal">if</span> <span class="Delimiter">(</span>in<span class="Delimiter">.</span>peek<span class="Delimiter">()</span> == <span class="Constant">'['</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> - string result = slurp_quoted<span class="Delimiter">(</span>in<span class="Delimiter">);</span> - skip_whitespace_and_comments_but_not_newline<span class="Delimiter">(</span>in<span class="Delimiter">);</span> - <span class="Identifier">return</span> result<span class="Delimiter">;</span> - <span class="Delimiter">}</span> - ostringstream out<span class="Delimiter">;</span> - slurp_word<span class="Delimiter">(</span>in<span class="Delimiter">,</span> out<span class="Delimiter">);</span> - skip_whitespace_and_comments<span class="Delimiter">(</span>in<span class="Delimiter">);</span> - <span class="Identifier">return</span> out<span class="Delimiter">.</span>str<span class="Delimiter">();</span> -<span class="Delimiter">}</span> - <span class="Normal">void</span> skip_whitespace<span class="Delimiter">(</span>istream& in<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">while</span> <span class="Delimiter">(</span><span class="Constant">true</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span class="Normal">if</span> <span class="Delimiter">(</span>!has_data<span class="Delimiter">(</span>in<span class="Delimiter">))</span> <span class="Identifier">break</span><span class="Delimiter">;</span> |