From 5fe060d582d4a82444243a28b18085c971a85628 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 27 Jul 2018 17:07:52 -0700 Subject: 4447 --- html/088file.mu.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'html/088file.mu.html') diff --git a/html/088file.mu.html b/html/088file.mu.html index 6f3a124d..d769c5ff 100644 --- a/html/088file.mu.html +++ b/html/088file.mu.html @@ -15,6 +15,7 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } +.muData { color: #ffff00; } .muRecipe { color: #ff8700; } .Special { color: #c00000; } .Delimiter { color: #800080; } @@ -23,7 +24,6 @@ a:hover { text-decoration: underline; } .Constant { color: #00a0a0; } .LineNr { color: #444444; } .muControl { color: #c0a020; } -.muData { color: #ffff00; } --> @@ -81,7 +81,7 @@ if ('onhashchange' in window) { 21 def start-reading resources:&:resources, filename:text -> contents:&:source:char, error?:bool [ 22 local-scope 23 load-inputs - 24 error? <- copy 0/false + 24 error? <- copy false 25 { 26 break-unless resources 27 # fake file system @@ -90,7 +90,7 @@ if ('onhashchange' in window) { 30 } 31 # real file system 32 file:num <- $open-file-for-reading filename - 33 return-unless file, 0/contents, 1/error? + 33 return-unless file, null/no-contents, true/error 34 contents:&:source:char, sink:&:sink:char <- new-channel 30 35 start-running receive-from-file file, sink 36 ] @@ -99,7 +99,7 @@ if ('onhashchange' in window) { 39 local-scope 40 load-inputs 41 source:&:source:char, error?:bool <- start-reading resources, filename - 42 return-if error?, 0/contents + 42 return-if error?, null/no-contents 43 buf:&:buffer:char <- new-buffer 30/capacity 44 { 45 c:char, done?:bool, source <- read source @@ -113,7 +113,7 @@ if ('onhashchange' in window) { 53 def start-reading-from-fake-resource resources:&:resources, resource:text -> contents:&:source:char, error?:bool [ 54 local-scope 55 load-inputs - 56 error? <- copy 0/no-error + 56 error? <- copy false 57 i:num <- copy 0 58 data:&:@:resource <- get *resources, data:offset 59 len:num <- length *data @@ -130,7 +130,7 @@ if ('onhashchange' in window) { 70 start-running receive-from-text curr-contents, sink 71 return 72 } - 73 return 0/not-found, 1/error + 73 return null/no-such-resource, true/error-found 74 ] 75 76 def receive-from-file file:num, sink:&:sink:char -> sink:&:sink:char [ @@ -165,7 +165,7 @@ if ('onhashchange' in window) { 105 def start-writing resources:&:resources, filename:text -> sink:&:sink:char, routine-id:num, error?:bool [ 106 local-scope 107 load-inputs -108 error? <- copy 0/false +108 error? <- copy false 109 source:&:source:char, sink:&:sink:char <- new-channel 30 110 { 111 break-unless resources @@ -175,7 +175,7 @@ if ('onhashchange' in window) { 115 } 116 # real file system 117 file:num <- $open-file-for-writing filename -118 return-unless file, 0/sink, 0/routine-id, 1/error? +118 return-unless file, null/sink, 0/routine-id, true/error 119 { 120 break-if file 121 msg:text <- append [no such file: ] filename @@ -188,7 +188,7 @@ if ('onhashchange' in window) { 128 local-scope 129 load-inputs 130 # todo: really create an empty file -131 return-unless contents, resources, 0/no-error +131 return-unless contents, resources, false/no-error 132 sink-file:&:sink:char, write-routine:num, error?:bool <- start-writing resources, filename 133 return-if error? 134 i:num <- copy 0 @@ -235,7 +235,7 @@ if ('onhashchange' in window) { 175 contents:text <- buffer-to-array buf 176 new-resource:resource <- merge filename, contents 177 # write to resources -178 curr-filename:text <- copy 0 +178 curr-filename:text <- copy null 179 data:&:@:resource <- get *resources, data:offset 180 # replace file contents if it already exists 181 i:num <- copy 0 -- cgit 1.4.1-2-gfad0