about summary refs log tree commit diff stats
path: root/html/060string.mu.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/060string.mu.html')
-rw-r--r--html/060string.mu.html77
1 files changed, 28 insertions, 49 deletions
diff --git a/html/060string.mu.html b/html/060string.mu.html
index eb98cd88..a78e7413 100644
--- a/html/060string.mu.html
+++ b/html/060string.mu.html
@@ -35,7 +35,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 <span class="Comment"># Some useful helpers for dealing with strings.</span>
 
 <span class="muRecipe">recipe</span> string-equal [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   a:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   a-len:number<span class="Special"> &lt;- </span>length a:address:array:character/deref
   b:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
@@ -138,9 +138,8 @@ container buffer [
 ]
 
 <span class="muRecipe">recipe</span> new-buffer [
-  <span class="Constant">new-default-space</span>
-<span class="CommentedCode">#?   $print default-space:address:array:location, [</span>
-<span class="CommentedCode">#? ]</span>
+  <span class="Constant">local-scope</span>
+<span class="CommentedCode">#?   $print default-space:address:array:location, 10:literal/newline</span>
   result:address:buffer<span class="Special"> &lt;- </span>new buffer:type
   len:address:number<span class="Special"> &lt;- </span>get-address result:address:buffer/deref, length:offset
   len:address:number/deref<span class="Special"> &lt;- </span>copy <span class="Constant">0:literal</span>
@@ -148,13 +147,12 @@ container buffer [
   capacity:number, found?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   assert found?:boolean, <span class="Constant">[new-buffer must get a capacity argument]</span>
   s:address:address:array:character/deref<span class="Special"> &lt;- </span>new character:type, capacity:number
-<span class="CommentedCode">#?   $print s:address:address:array:character/deref, [</span>
-<span class="CommentedCode">#? ]</span>
+<span class="CommentedCode">#?   $print s:address:address:array:character/deref, 10:literal/newline</span>
   <span class="muControl">reply</span> result:address:buffer
 ]
 
 <span class="muRecipe">recipe</span> grow-buffer [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   in:address:buffer<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># double buffer size</span>
   x:address:address:array:character<span class="Special"> &lt;- </span>get-address in:address:buffer/deref, data:offset
@@ -177,7 +175,7 @@ container buffer [
 ]
 
 <span class="muRecipe">recipe</span> buffer-full? [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   in:address:buffer<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   len:number<span class="Special"> &lt;- </span>get in:address:buffer/deref, length:offset
   s:address:array:character<span class="Special"> &lt;- </span>get in:address:buffer/deref, data:offset
@@ -188,7 +186,7 @@ container buffer [
 
 <span class="Comment"># in:address:buffer &lt;- buffer-append in:address:buffer, c:character</span>
 <span class="muRecipe">recipe</span> buffer-append [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   in:address:buffer<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   c:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   len:address:number<span class="Special"> &lt;- </span>get-address in:address:buffer/deref, length:offset
@@ -208,13 +206,10 @@ container buffer [
     in:address:buffer<span class="Special"> &lt;- </span>grow-buffer in:address:buffer
   <span class="Delimiter">}</span>
   s:address:array:character<span class="Special"> &lt;- </span>get in:address:buffer/deref, data:offset
-<span class="CommentedCode">#?   $print [array underlying buf: ], s:address:array:character, [ </span>
-<span class="CommentedCode">#? ] #? 1</span>
-<span class="CommentedCode">#?   $print [index: ], len:address:number/deref, [ </span>
-<span class="CommentedCode">#? ] #? 1</span>
+<span class="CommentedCode">#?   $print [array underlying buf: ], s:address:array:character, 10:literal/newline</span>
+<span class="CommentedCode">#?   $print [index: ], len:address:number/deref, 10:literal/newline</span>
   dest:address:character<span class="Special"> &lt;- </span>index-address s:address:array:character/deref, len:address:number/deref
-<span class="CommentedCode">#?   $print [storing ], c:character, [ in ], dest:address:character, [ </span>
-<span class="CommentedCode">#? ] #? 1</span>
+<span class="CommentedCode">#?   $print [storing ], c:character, [ in ], dest:address:character, 10:literal/newline</span>
   dest:address:character/deref<span class="Special"> &lt;- </span>copy c:character
   len:address:number/deref<span class="Special"> &lt;- </span>add len:address:number/deref, <span class="Constant">1:literal</span>
   <span class="muControl">reply</span> in:address:buffer/same-as-ingredient:0
@@ -222,7 +217,7 @@ container buffer [
 
 <span class="muScenario">scenario</span> buffer-append-works [
   run [
-    <span class="Constant">new-default-space</span>
+    <span class="Constant">local-scope</span>
     x:address:buffer<span class="Special"> &lt;- </span>new-buffer <span class="Constant">3:literal</span>
     s1:address:array:character<span class="Special"> &lt;- </span>get x:address:buffer/deref, data:offset
     x:address:buffer<span class="Special"> &lt;- </span>buffer-append x:address:buffer, <span class="Constant">97:literal</span>  <span class="Comment"># 'a'</span>
@@ -230,20 +225,6 @@ container buffer [
     x:address:buffer<span class="Special"> &lt;- </span>buffer-append x:address:buffer, <span class="Constant">99:literal</span>  <span class="Comment"># 'c'</span>
     s2:address:array:character<span class="Special"> &lt;- </span>get x:address:buffer/deref, data:offset
     1:boolean/<span class="Special">raw &lt;- </span>equal s1:address:array:character, s2:address:array:character
-<span class="CommentedCode">#?     $print s2:address:array:character, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1060:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1061:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1062:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1063:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1064:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
-<span class="CommentedCode">#?     $print 1065:number/raw, [</span>
-<span class="CommentedCode">#? ]</span>
     2:array:character/<span class="Special">raw &lt;- </span>copy s2:address:array:character/deref
 <span class="Constant">    +buffer-filled</span>
     x:address:buffer<span class="Special"> &lt;- </span>buffer-append x:address:buffer, <span class="Constant">100:literal</span>  <span class="Comment"># 'd'</span>
@@ -274,7 +255,7 @@ container buffer [
 
 <span class="muScenario">scenario</span> buffer-append-handles-backspace [
   run [
-    <span class="Constant">new-default-space</span>
+    <span class="Constant">local-scope</span>
     x:address:buffer<span class="Special"> &lt;- </span>new-buffer <span class="Constant">3:literal</span>
     x:address:buffer<span class="Special"> &lt;- </span>buffer-append x:address:buffer, <span class="Constant">97:literal</span>  <span class="Comment"># 'a'</span>
     x:address:buffer<span class="Special"> &lt;- </span>buffer-append x:address:buffer, <span class="Constant">98:literal</span>  <span class="Comment"># 'b'</span>
@@ -291,7 +272,7 @@ container buffer [
 
 <span class="Comment"># result:address:array:character &lt;- integer-to-decimal-string n:number</span>
 <span class="muRecipe">recipe</span> integer-to-decimal-string [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   n:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># is it zero?</span>
   <span class="Delimiter">{</span>
@@ -347,7 +328,7 @@ container buffer [
 ]
 
 <span class="muRecipe">recipe</span> buffer-to-array [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   in:address:buffer<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Delimiter">{</span>
     <span class="Comment"># propagate null buffer</span>
@@ -355,8 +336,7 @@ container buffer [
     <span class="muControl">reply</span> <span class="Constant">0:literal</span>
   <span class="Delimiter">}</span>
   len:number<span class="Special"> &lt;- </span>get in:address:buffer/deref, length:offset
-<span class="CommentedCode">#?   $print [size ], len:number, [ </span>
-<span class="CommentedCode">#? ] #? 1</span>
+<span class="CommentedCode">#?   $print [size ], len:number, 10:literal/newline</span>
   s:address:array:character<span class="Special"> &lt;- </span>get in:address:buffer/deref, data:offset
   <span class="Comment"># we can't just return s because it is usually the wrong length</span>
   result:address:array:character<span class="Special"> &lt;- </span>new character:type, len:number
@@ -408,7 +388,7 @@ container buffer [
 
 <span class="Comment"># result:address:array:character &lt;- string-append a:address:array:character, b:address:array:character</span>
 <span class="muRecipe">recipe</span> string-append [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   <span class="Comment"># result = new character[a.length + b.length]</span>
   a:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   a-len:number<span class="Special"> &lt;- </span>length a:address:array:character/deref
@@ -467,7 +447,7 @@ container buffer [
 <span class="Comment"># replace underscores in first with remaining args</span>
 <span class="Comment"># result:address:array:character &lt;- interpolate template:address:array:character, ...</span>
 <span class="muRecipe">recipe</span> interpolate [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   template:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># compute result-len, space to allocate for result</span>
   tem-len:number<span class="Special"> &lt;- </span>length template:address:array:character/deref
@@ -482,8 +462,7 @@ container buffer [
     result-len:number<span class="Special"> &lt;- </span>subtract result-len:number, <span class="Constant">1:literal</span>
     <span class="muControl">loop</span>
   <span class="Delimiter">}</span>
-<span class="CommentedCode">#?   $print tem-len:number, [ ], $result-len:number, [ </span>
-<span class="CommentedCode">#? ] #? 1</span>
+<span class="CommentedCode">#?   $print tem-len:number, [ ], $result-len:number, 10:literal/newline</span>
   rewind-ingredients
   _<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>  <span class="Comment"># skip template</span>
   <span class="Comment"># result = new array:character[result-len]</span>
@@ -592,7 +571,7 @@ container buffer [
 
 <span class="Comment"># result:boolean &lt;- space? c:character</span>
 <span class="muRecipe">recipe</span> space? [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   c:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># most common case first</span>
   result:boolean<span class="Special"> &lt;- </span>equal c:character, <span class="Constant">32:literal/space</span>
@@ -657,7 +636,7 @@ container buffer [
 
 <span class="Comment"># result:address:array:character &lt;- trim s:address:array:character</span>
 <span class="muRecipe">recipe</span> trim [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   s:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   len:number<span class="Special"> &lt;- </span>length s:address:array:character/deref
   <span class="Comment"># left trim: compute start</span>
@@ -766,7 +745,7 @@ container buffer [
 
 <span class="Comment"># next-index:number &lt;- find-next text:address:array:character, pattern:character</span>
 <span class="muRecipe">recipe</span> find-next [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   text:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   pattern:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   idx:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
@@ -866,7 +845,7 @@ container buffer [
 <span class="Comment"># like find-next, but searches for multiple characters</span>
 <span class="Comment"># fairly dumb algorithm</span>
 <span class="muRecipe">recipe</span> find-substring [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   text:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   pattern:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   idx:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
@@ -945,7 +924,7 @@ container buffer [
 <span class="Comment"># result:boolean &lt;- match-at text:address:array:character, pattern:address:array:character, idx:number</span>
 <span class="Comment"># checks if substring matches at index 'idx'</span>
 <span class="muRecipe">recipe</span> match-at [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   text:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   pattern:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   idx:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
@@ -1076,7 +1055,7 @@ container buffer [
 
 <span class="Comment"># result:address:array:address:array:character &lt;- split s:address:array:character, delim:character</span>
 <span class="muRecipe">recipe</span> split [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   s:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   delim:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># empty string? return empty array</span>
@@ -1206,7 +1185,7 @@ container buffer [
 
 <span class="Comment"># x:address:array:character, y:address:array:character &lt;- split-first text:address:array:character, delim:character</span>
 <span class="muRecipe">recipe</span> split-first [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   text:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   delim:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Comment"># empty string? return empty strings</span>
@@ -1241,7 +1220,7 @@ container buffer [
 <span class="Comment"># result:address:array:character &lt;- string-copy buf:address:array:character, start:number, end:number</span>
 <span class="Comment"># todo: make this generic</span>
 <span class="muRecipe">recipe</span> string-copy [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   buf:address:array:character<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   start:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   end:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
@@ -1301,7 +1280,7 @@ container buffer [
 ]
 
 <span class="muRecipe">recipe</span> min [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   x:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   y:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Delimiter">{</span>
@@ -1313,7 +1292,7 @@ container buffer [
 ]
 
 <span class="muRecipe">recipe</span> max [
-  <span class="Constant">new-default-space</span>
+  <span class="Constant">local-scope</span>
   x:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   y:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
   <span class="Delimiter">{</span>