From 4a48bedcd1d708a43d43dc6259a4e45c52ea3d00 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 3 Dec 2017 23:25:40 -0800 Subject: 4134 - 'input' = 'ingredient' --- html/061text.mu.html | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'html/061text.mu.html') diff --git a/html/061text.mu.html b/html/061text.mu.html index f8cb25e4..cb9ca6d3 100644 --- a/html/061text.mu.html +++ b/html/061text.mu.html @@ -64,7 +64,7 @@ if ('onhashchange' in window) { 2 3 def equal a:text, b:text -> result:bool [ 4 local-scope - 5 load-ingredients + 5 load-inputs 6 an:num, bn:num <- copy a, b 7 address-equal?:boolean <- equal an, bn 8 return-if address-equal?, 1/true @@ -186,7 +186,7 @@ if ('onhashchange' in window) { 124 125 def new-buffer capacity:num -> result:&:buffer:_elem [ 126 local-scope - 127 load-ingredients + 127 load-inputs 128 result <- new {(buffer _elem): type} 129 *result <- put *result, length:offset, 0 130 { @@ -201,7 +201,7 @@ if ('onhashchange' in window) { 139 140 def grow-buffer buf:&:buffer:_elem -> buf:&:buffer:_elem [ 141 local-scope - 142 load-ingredients + 142 load-inputs 143 # double buffer size 144 olddata:&:@:_elem <- get *buf, data:offset 145 oldlen:num <- length *olddata @@ -222,7 +222,7 @@ if ('onhashchange' in window) { 160 161 def buffer-full? in:&:buffer:_elem -> result:bool [ 162 local-scope - 163 load-ingredients + 163 load-inputs 164 len:num <- get *in, length:offset 165 s:&:@:_elem <- get *in, data:offset 166 capacity:num <- length *s @@ -232,7 +232,7 @@ if ('onhashchange' in window) { 170 # most broadly applicable definition of append to a buffer 171 def append buf:&:buffer:_elem, x:_elem -> buf:&:buffer:_elem [ 172 local-scope - 173 load-ingredients + 173 load-inputs 174 len:num <- get *buf, length:offset 175 { 176 ¦ # grow buffer if necessary @@ -250,7 +250,7 @@ if ('onhashchange' in window) { 188 # call to-text 189 def append buf:&:buffer:char, x:_elem -> buf:&:buffer:char [ 190 local-scope - 191 load-ingredients + 191 load-inputs 192 text:text <- to-text x 193 buf <- append buf, text 194 ] @@ -258,7 +258,7 @@ if ('onhashchange' in window) { 196 # specialization for characters that is backspace-aware 197 def append buf:&:buffer:char, c:char -> buf:&:buffer:char [ 198 local-scope - 199 load-ingredients + 199 load-inputs 200 len:num <- get *buf, length:offset 201 { 202 ¦ # backspace? just drop last character if it exists and return @@ -284,7 +284,7 @@ if ('onhashchange' in window) { 222 223 def append buf:&:buffer:_elem, t:&:@:_elem -> buf:&:buffer:_elem [ 224 local-scope - 225 load-ingredients + 225 load-inputs 226 len:num <- length *t 227 i:num <- copy 0 228 { @@ -399,7 +399,7 @@ if ('onhashchange' in window) { 337 338 def buffer-to-array in:&:buffer:_elem -> result:&:@:_elem [ 339 local-scope - 340 load-ingredients + 340 load-inputs 341 # propagate null buffer 342 return-unless in, 0 343 len:num <- get *in, length:offset @@ -419,7 +419,7 @@ if ('onhashchange' in window) { 357 358 def blank? x:&:@:_elem -> result:bool [ 359 local-scope - 360 load-ingredients + 360 load-inputs 361 return-unless x, 1/true 362 len:num <- length *x 363 result <- equal len, 0 @@ -435,16 +435,16 @@ if ('onhashchange' in window) { 373 # will never ever get used. 374 def append first:text -> result:text [ 375 local-scope - 376 load-ingredients + 376 load-inputs 377 buf:&:buffer:char <- new-buffer 30 - 378 # append first ingredient + 378 # append first input 379 { 380 ¦ break-unless first 381 ¦ buf <- append buf, first 382 } - 383 # append remaining ingredients + 383 # append remaining inputs 384 { - 385 ¦ arg:text, arg-found?:bool <- next-ingredient + 385 ¦ arg:text, arg-found?:bool <- next-input 386 ¦ break-unless arg-found? 387 ¦ loop-unless arg 388 ¦ buf <- append buf, arg @@ -520,7 +520,7 @@ if ('onhashchange' in window) { 458 459 def replace s:text, oldc:char, newc:char, from:num/optional -> s:text [ 460 local-scope - 461 load-ingredients + 461 load-inputs 462 len:num <- length *s 463 i:num <- find-next s, oldc, from 464 done?:bool <- greater-or-equal i, len @@ -581,13 +581,13 @@ if ('onhashchange' in window) { 519 # replace underscores in first with remaining args 520 def interpolate template:text -> result:text [ 521 local-scope - 522 load-ingredients # consume just the template + 522 load-inputs # consume just the template 523 # compute result-len, space to allocate for result 524 tem-len:num <- length *template 525 result-len:num <- copy tem-len 526 { - 527 ¦ # while ingredients remain - 528 ¦ a:text, arg-received?:bool <- next-ingredient + 527 ¦ # while inputs remain + 528 ¦ a:text, arg-received?:bool <- next-input 529 ¦ break-unless arg-received? 530 ¦ # result-len = result-len + arg.length - 1 (for the 'underscore' being replaced) 531 ¦ a-len:num <- length *a @@ -595,15 +595,15 @@ if ('onhashchange' in window) { 533 ¦ result-len <- subtract result-len, 1 534 ¦ loop 535 } - 536 rewind-ingredients - 537 _ <- next-ingredient # skip template + 536 rewind-inputs + 537 _ <- next-input # skip template 538 result <- new character:type, result-len 539 # repeatedly copy sections of template and 'holes' into result 540 result-idx:num <- copy 0 541 i:num <- copy 0 542 { 543 ¦ # while arg received - 544 ¦ a:text, arg-received?:bool <- next-ingredient + 544 ¦ a:text, arg-received?:bool <- next-input 545 ¦ break-unless arg-received? 546 ¦ # copy template into result until '_' 547 ¦ { @@ -695,7 +695,7 @@ if ('onhashchange' in window) { 633 # result:bool <- space? c:char 634 def space? c:char -> result:bool [ 635 local-scope - 636 load-ingredients + 636 load-inputs 637 # most common case first 638 result <- equal c, 32/space 639 return-if result @@ -756,7 +756,7 @@ if ('onhashchange' in window) { 694 695 def trim s:text -> result:text [ 696 local-scope - 697 load-ingredients + 697 load-inputs 698 len:num <- length *s 699 # left trim: compute start 700 start:num <- copy 0 @@ -866,7 +866,7 @@ if ('onhashchange' in window) { 804 805 def find-next text:text, pattern:char, idx:num -> next-index:num [ 806 local-scope - 807 load-ingredients + 807 load-inputs 808 len:num <- length *text 809 { 810 ¦ eof?:bool <- greater-or-equal idx, len @@ -972,7 +972,7 @@ if ('onhashchange' in window) { 910 # fairly dumb algorithm 911 def find-next text:text, pattern:text, idx:num -> next-index:num [ 912 local-scope - 913 load-ingredients + 913 load-inputs 914 first:char <- index *pattern, 0 915 # repeatedly check for match at current idx 916 len:num <- length *text @@ -1053,7 +1053,7 @@ if ('onhashchange' in window) { 991 # checks if pattern matches at index 'idx' 992 def match-at text:text, pattern:text, idx:num -> result:bool [ 993 local-scope - 994 load-ingredients + 994 load-inputs 995 pattern-len:num <- length *pattern 996 # check that there's space left for the pattern 997 x:num <- length *text @@ -1184,7 +1184,7 @@ if ('onhashchange' in window) { 1122 1123 def split s:text, delim:char -> result:&:@:text [ 1124 local-scope -1125 load-ingredients +1125 load-inputs 1126 # empty text? return empty array 1127 len:num <- length *s 1128 { @@ -1316,7 +1316,7 @@ if ('onhashchange' in window) { 1254 1255 def split-first text:text, delim:char -> x:text, y:text [ 1256 local-scope -1257 load-ingredients +1257 load-inputs 1258 # empty text? return empty texts 1259 len:num <- length *text 1260 { @@ -1348,7 +1348,7 @@ if ('onhashchange' in window) { 1286 1287 def copy-range buf:text, start:num, end:num -> result:text [ 1288 local-scope -1289 load-ingredients +1289 load-inputs 1290 # if end is out of bounds, trim it 1291 len:num <- length *buf 1292 end:num <- min len, end @@ -1407,7 +1407,7 @@ if ('onhashchange' in window) { 1345 1346 def parse-whole-number in:text -> out:num, error?:bool [ 1347 local-scope -1348 load-ingredients +1348 load-inputs 1349 out <- copy 0 1350 result:num <- copy 0 # temporary location 1351 i:num <- copy 0 @@ -1431,7 +1431,7 @@ if ('onhashchange' in window) { 1369 # (contributed by Ella Couch) 1370 recipe character-code-to-digit character-code:number -> result:number, error?:boolean [ 1371 local-scope -1372 load-ingredients +1372 load-inputs 1373 result <- copy 0 1374 error? <- lesser-than character-code, 48 # '0' 1375 return-if error? -- cgit 1.4.1-2-gfad0