From f5465e1220d73e237c51897b7d1211ec53b0dc04 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 7 Sep 2015 10:37:27 -0700 Subject: 2177 --- html/066stream.mu.html | 72 ++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 35 deletions(-) (limited to 'html/066stream.mu.html') diff --git a/html/066stream.mu.html b/html/066stream.mu.html index a43f8090..23a019f6 100644 --- a/html/066stream.mu.html +++ b/html/066stream.mu.html @@ -13,10 +13,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; } body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } -.Special { color: #ff6060; } +.muRecipe { color: #ff8700; } +.muData { color: #ffff00; } .Comment { color: #9090ff; } -.Underlined { color: #c000c0; text-decoration: underline; } -.Identifier { color: #804000; } +.Constant { color: #00a0a0; } +.Special { color: #ff6060; } +.muControl { color: #c0a020; } --> @@ -29,48 +31,48 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 # new type to help incrementally read strings
-container stream [
+container stream [
   index:number
-  data:address:array:character
+  data:address:array:character
 ]
 
-recipe new-stream [
-  local-scope
-  result:address:stream <- new stream:type
-  i:address:number <- get-address *result, index:offset
-  *i <- copy 0
-  d:address:address:array:character <- get-address *result, data:offset
-  *d <- next-ingredient
-  reply result
+recipe new-stream [
+  local-scope
+  result:address:stream <- new stream:type
+  i:address:number <- get-address *result, index:offset
+  *i <- copy 0
+  d:address:address:array:character <- get-address *result, data:offset
+  *d <- next-ingredient
+  reply result
 ]
 
-recipe rewind-stream [
-  local-scope
-  in:address:stream <- next-ingredient
-  x:address:number <- get-address *in, index:offset
-  *x <- copy 0
-  reply in/same-as-arg:0
+recipe rewind-stream [
+  local-scope
+  in:address:stream <- next-ingredient
+  x:address:number <- get-address *in, index:offset
+  *x <- copy 0
+  reply in/same-as-arg:0
 ]
 
-recipe read-line [
-  local-scope
-  in:address:stream <- next-ingredient
-  idx:address:number <- get-address *in, index:offset
-  s:address:array:character <- get *in, data:offset
-  next-idx:number <- find-next s, 10/newline, *idx
-  result:address:array:character <- string-copy s, *idx, next-idx
-  *idx <- add next-idx, 1  # skip newline
-  reply result
+recipe read-line [
+  local-scope
+  in:address:stream <- next-ingredient
+  idx:address:number <- get-address *in, index:offset
+  s:address:array:character <- get *in, data:offset
+  next-idx:number <- find-next s, 10/newline, *idx
+  result:address:array:character <- string-copy s, *idx, next-idx
+  *idx <- add next-idx, 1  # skip newline
+  reply result
 ]
 
-recipe end-of-stream? [
-  local-scope
-  in:address:stream <- next-ingredient
-  idx:address:number <- get *in, index:offset
-  s:address:array:character <- get *in, data:offset
-  len:number <- length *s
+recipe end-of-stream? [
+  local-scope
+  in:address:stream <- next-ingredient
+  idx:address:number <- get *in, index:offset
+  s:address:array:character <- get *in, data:offset
+  len:number <- length *s
   result:boolean <- greater-or-equal idx, len
-  reply result
+  reply result
 ]
 
-- cgit 1.4.1-2-gfad0