diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-05-29 14:21:32 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-05-29 14:21:32 -0700 |
commit | 2c678a4e1d7f97c862342ee19cf2d6ee6e901d85 (patch) | |
tree | aa2954661eac22bd347e3fe28262a99481d42ff1 /html/038new_text.cc.html | |
parent | 0bc6fbd396f35e8dfd5cf5f5827b4ba665c3fcdf (diff) | |
download | mu-2c678a4e1d7f97c862342ee19cf2d6ee6e901d85.tar.gz |
3897 - various updates to documentation
Diffstat (limited to 'html/038new_text.cc.html')
-rw-r--r-- | html/038new_text.cc.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/html/038new_text.cc.html b/html/038new_text.cc.html index d5ae935f..5706e13a 100644 --- a/html/038new_text.cc.html +++ b/html/038new_text.cc.html @@ -67,7 +67,7 @@ if ('onhashchange' in window) { <span id="L2" class="LineNr"> 2 </span> <span id="L3" class="LineNr"> 3 </span><span class="Comment">//: A Mu text is an address to an array of characters.</span> <span id="L4" class="LineNr"> 4 </span><span class="Delimiter">:(before "End Mu Types Initialization")</span> -<span id="L5" class="LineNr"> 5 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Type_abbreviations<span class="Delimiter">,</span> <span class="Constant">"text"</span><span class="Delimiter">,</span> <a href='018type_abbreviations.cc.html#L58'>new_type_tree</a><span class="Delimiter">(</span><span class="Constant">"address:array:character"</span><span class="Delimiter">));</span> +<span id="L5" class="LineNr"> 5 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Type_abbreviations<span class="Delimiter">,</span> <span class="Constant">"text"</span><span class="Delimiter">,</span> <a href='018type_abbreviations.cc.html#L58'>new_type_tree</a><span class="Delimiter">(</span><span class="Constant">"address:array:character"</span><span class="Delimiter">));</span> <span id="L6" class="LineNr"> 6 </span> <span id="L7" class="LineNr"> 7 </span><span class="Delimiter">:(scenario new_string)</span> <span id="L8" class="LineNr"> 8 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ @@ -107,19 +107,19 @@ if ('onhashchange' in window) { <span id="L42" class="LineNr"> 42 </span><span class="CommentedCode">//? ++Num_alloc;</span> <span id="L43" class="LineNr"> 43 </span> <span class="Normal">int</span> result = allocate<span class="Delimiter">(</span>string_length+<span class="Comment">/*</span><span class="Comment">array length</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L44" class="LineNr"> 44 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing string refcount 0 in location "</span> << result << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L45" class="LineNr"> 45 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> +<span id="L45" class="LineNr"> 45 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> result<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L46" class="LineNr"> 46 </span> <span class="Normal">int</span> curr_address = result+<span class="Comment">/*</span><span class="Comment">skip refcount</span><span class="Comment">*/</span><span class="Constant">1</span><span class="Delimiter">;</span> <span id="L47" class="LineNr"> 47 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing string length "</span> << string_length << <span class="Constant">" in location "</span> << curr_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L48" class="LineNr"> 48 </span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> string_length<span class="Delimiter">);</span> +<span id="L48" class="LineNr"> 48 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> string_length<span class="Delimiter">);</span> <span id="L49" class="LineNr"> 49 </span> ++curr_address<span class="Delimiter">;</span> <span class="Comment">// skip length</span> <span id="L50" class="LineNr"> 50 </span> <span class="Normal">int</span> curr = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L51" class="LineNr"> 51 </span> <span class="Normal">const</span> <span class="Normal">char</span>* raw_contents = contents<span class="Delimiter">.</span>c_str<span class="Delimiter">();</span> <span id="L52" class="LineNr"> 52 </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 < string_length<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L53" class="LineNr"> 53 </span> <span class="Conceal">¦</span> <span class="Normal">uint32_t</span> curr_character<span class="Delimiter">;</span> -<span id="L54" class="LineNr"> 54 </span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>curr < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>contents<span class="Delimiter">));</span> +<span id="L54" class="LineNr"> 54 </span> <span class="Conceal">¦</span> assert<span class="Delimiter">(</span>curr < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>contents<span class="Delimiter">));</span> <span id="L55" class="LineNr"> 55 </span> <span class="Conceal">¦</span> tb_utf8_char_to_unicode<span class="Delimiter">(</span>&curr_character<span class="Delimiter">,</span> &raw_contents[curr]<span class="Delimiter">);</span> <span id="L56" class="LineNr"> 56 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing string character "</span> << curr_character << <span class="Constant">" in location "</span> << curr_address << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> -<span id="L57" class="LineNr"> 57 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> curr_character<span class="Delimiter">);</span> +<span id="L57" class="LineNr"> 57 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr_address<span class="Delimiter">,</span> curr_character<span class="Delimiter">);</span> <span id="L58" class="LineNr"> 58 </span> <span class="Conceal">¦</span> curr += tb_utf8_char_length<span class="Delimiter">(</span>raw_contents[curr]<span class="Delimiter">);</span> <span id="L59" class="LineNr"> 59 </span> <span class="Conceal">¦</span> ++curr_address<span class="Delimiter">;</span> <span id="L60" class="LineNr"> 60 </span> <span class="Delimiter">}</span> @@ -197,7 +197,7 @@ if ('onhashchange' in window) { <span id="L132" class="LineNr">132 </span> <span class="Normal">const</span> <span class="Normal">char</span>* in = s<span class="Delimiter">.</span>c_str<span class="Delimiter">();</span> <span id="L133" class="LineNr">133 </span> <span class="Normal">int</span> result = <span class="Constant">0</span><span class="Delimiter">;</span> <span id="L134" class="LineNr">134 </span> <span class="Normal">int</span> curr = <span class="Constant">0</span><span class="Delimiter">;</span> -<span id="L135" class="LineNr">135 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>curr < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>s<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// carefully bounds-check on the string</span> +<span id="L135" class="LineNr">135 </span> <span class="Normal">while</span> <span class="Delimiter">(</span>curr < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>s<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// carefully bounds-check on the string</span> <span id="L136" class="LineNr">136 </span> <span class="Conceal">¦</span> <span class="Comment">// before accessing its raw pointer</span> <span id="L137" class="LineNr">137 </span> <span class="Conceal">¦</span> ++result<span class="Delimiter">;</span> <span id="L138" class="LineNr">138 </span> <span class="Conceal">¦</span> curr += tb_utf8_char_length<span class="Delimiter">(</span>in[curr]<span class="Delimiter">);</span> @@ -208,11 +208,11 @@ if ('onhashchange' in window) { <span id="L143" class="LineNr">143 </span>string <a href='038new_text.cc.html#L143'>read_mu_text</a><span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L144" class="LineNr">144 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">""</span><span class="Delimiter">;</span> <span id="L145" class="LineNr">145 </span> ++address<span class="Delimiter">;</span> <span class="Comment">// skip refcount</span> -<span id="L146" class="LineNr">146 </span> <span class="Normal">int</span> size = <a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">);</span> +<span id="L146" class="LineNr">146 </span> <span class="Normal">int</span> size = <a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">);</span> <span id="L147" class="LineNr">147 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>size == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">""</span><span class="Delimiter">;</span> <span id="L148" class="LineNr">148 </span> ostringstream tmp<span class="Delimiter">;</span> <span id="L149" class="LineNr">149 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> curr = address+<span class="Constant">1</span><span class="Delimiter">;</span> curr <= address+size<span class="Delimiter">;</span> ++curr<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L150" class="LineNr">150 </span> <span class="Conceal">¦</span> tmp << to_unicode<span class="Delimiter">(</span><span class="Normal">static_cast</span><<span class="Normal">uint32_t</span>><span class="Delimiter">(</span><a href='001help.cc.html#L225'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr<span class="Delimiter">)));</span> +<span id="L150" class="LineNr">150 </span> <span class="Conceal">¦</span> tmp << to_unicode<span class="Delimiter">(</span><span class="Normal">static_cast</span><<span class="Normal">uint32_t</span>><span class="Delimiter">(</span><a href='001help.cc.html#L228'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> curr<span class="Delimiter">)));</span> <span id="L151" class="LineNr">151 </span> <span class="Delimiter">}</span> <span id="L152" class="LineNr">152 </span> <span class="Identifier">return</span> tmp<span class="Delimiter">.</span>str<span class="Delimiter">();</span> <span id="L153" class="LineNr">153 </span><span class="Delimiter">}</span> @@ -231,10 +231,10 @@ if ('onhashchange' in window) { <span id="L166" class="LineNr">166 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L167" class="LineNr">167 </span>ASSERT<span class="Delimiter">,</span> <span id="L168" class="LineNr">168 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L169" class="LineNr">169 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"assert"</span><span class="Delimiter">,</span> ASSERT<span class="Delimiter">);</span> +<span id="L169" class="LineNr">169 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"assert"</span><span class="Delimiter">,</span> ASSERT<span class="Delimiter">);</span> <span id="L170" class="LineNr">170 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L171" class="LineNr">171 </span><span class="Normal">case</span> ASSERT: <span class="Delimiter">{</span> -<span id="L172" class="LineNr">172 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L172" class="LineNr">172 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L173" class="LineNr">173 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'assert' takes exactly two ingredients rather than '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L174" class="LineNr">174 </span> <span class="Conceal">¦</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L175" class="LineNr">175 </span> <span class="Delimiter">}</span> @@ -265,7 +265,7 @@ if ('onhashchange' in window) { <span id="L200" class="LineNr">200 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L201" class="LineNr">201 </span>_READ<span class="Delimiter">,</span> <span id="L202" class="LineNr">202 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L203" class="LineNr">203 </span><a href='001help.cc.html#L218'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"$read"</span><span class="Delimiter">,</span> _READ<span class="Delimiter">);</span> +<span id="L203" class="LineNr">203 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"$read"</span><span class="Delimiter">,</span> _READ<span class="Delimiter">);</span> <span id="L204" class="LineNr">204 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L205" class="LineNr">205 </span><span class="Normal">case</span> _READ: <span class="Delimiter">{</span> <span id="L206" class="LineNr">206 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -274,7 +274,7 @@ if ('onhashchange' in window) { <span id="L209" class="LineNr">209 </span><span class="Normal">case</span> _READ: <span class="Delimiter">{</span> <span id="L210" class="LineNr">210 </span> <a href='038new_text.cc.html#L220'>skip_whitespace</a><span class="Delimiter">(</span>cin<span class="Delimiter">);</span> <span id="L211" class="LineNr">211 </span> string result<span class="Delimiter">;</span> -<span id="L212" class="LineNr">212 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L235'>has_data</a><span class="Delimiter">(</span>cin<span class="Delimiter">))</span> +<span id="L212" class="LineNr">212 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L238'>has_data</a><span class="Delimiter">(</span>cin<span class="Delimiter">))</span> <span id="L213" class="LineNr">213 </span> <span class="Conceal">¦</span> cin >> result<span class="Delimiter">;</span> <span id="L214" class="LineNr">214 </span> products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L215" class="LineNr">215 </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><a href='038new_text.cc.html#L38'>new_mu_text</a><span class="Delimiter">(</span>result<span class="Delimiter">));</span> |