comparison src/demo.sml @ 1614:efe1a2e9e4de

Support 'safeGet' in demos
author Adam Chlipala <adam@chlipala.net>
date Fri, 25 Nov 2011 17:19:34 -0500
parents 2f5fd248588d
children 7b9775d4a8ce
comparison
equal deleted inserted replaced
1613:4973d31b5fff 1614:efe1a2e9e4de
117 filterRequest = #filterRequest combined @ #filterRequest urp, 117 filterRequest = #filterRequest combined @ #filterRequest urp,
118 filterResponse = #filterResponse combined @ #filterResponse urp, 118 filterResponse = #filterResponse combined @ #filterResponse urp,
119 protocol = mergeWith #2 (#protocol combined, #protocol urp), 119 protocol = mergeWith #2 (#protocol combined, #protocol urp),
120 dbms = mergeWith #2 (#dbms combined, #dbms urp), 120 dbms = mergeWith #2 (#dbms combined, #dbms urp),
121 sigFile = mergeWith #2 (#sigFile combined, #sigFile urp), 121 sigFile = mergeWith #2 (#sigFile combined, #sigFile urp),
122 safeGets = [], 122 safeGets = #safeGets combined @ #safeGets urp,
123 onError = NONE, 123 onError = NONE,
124 minHeap = 0 124 minHeap = 0
125 } 125 }
126 126
127 val parse = Compiler.run (Compiler.transform Compiler.parseUrp "Demo parseUrp") 127 val parse = Compiler.run (Compiler.transform Compiler.parseUrp "Demo parseUrp")
424 TextIO.output (outf, " "); 424 TextIO.output (outf, " ");
425 TextIO.output (outf, #to rule); 425 TextIO.output (outf, #to rule);
426 TextIO.output (outf, "\n"))) (#rewrites combined); 426 TextIO.output (outf, "\n"))) (#rewrites combined);
427 filters "url" (#filterUrl combined); 427 filters "url" (#filterUrl combined);
428 filters "mime" (#filterMime combined); 428 filters "mime" (#filterMime combined);
429 app (fn path =>
430 (TextIO.output (outf, "safeGet ");
431 TextIO.output (outf, path);
432 TextIO.output (outf, "\n"))) (#safeGets combined);
429 TextIO.output (outf, "\n"); 433 TextIO.output (outf, "\n");
430 434
431 app (fn s => 435 app (fn s =>
432 let 436 let
433 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (), 437 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (),