comparison src/demo.sml @ 385:1195f6e4d208

Support for URL prefixes that works with local demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 19 Oct 2008 15:47:47 -0400
parents 2a7e7bd7b29f
children c5a3d223f157
comparison
equal deleted inserted replaced
384:2a7e7bd7b29f 385:1195f6e4d208
73 (NONE, _) => o2 73 (NONE, _) => o2
74 | (_, NONE) => o1 74 | (_, NONE) => o1
75 | (SOME v1, SOME v2) => SOME (f (v1, v2)) 75 | (SOME v1, SOME v2) => SOME (f (v1, v2))
76 76
77 fun combiner (combined : Compiler.job, urp : Compiler.job) = { 77 fun combiner (combined : Compiler.job, urp : Compiler.job) = {
78 prefix = prefix,
78 database = mergeWith (fn (v1, v2) => 79 database = mergeWith (fn (v1, v2) =>
79 if v1 = v2 then 80 if v1 = v2 then
80 v1 81 v1
81 else 82 else
82 raise Fail "Different demos want to use different database strings") 83 raise Fail "Different demos want to use different database strings")
335 Option.app (fn db => (TextIO.output (outf, "database "); 336 Option.app (fn db => (TextIO.output (outf, "database ");
336 TextIO.output (outf, db); 337 TextIO.output (outf, db);
337 TextIO.output (outf, "\n"))) 338 TextIO.output (outf, "\n")))
338 (#database combined); 339 (#database combined);
339 TextIO.output (outf, "sql demo.sql\n"); 340 TextIO.output (outf, "sql demo.sql\n");
341 TextIO.output (outf, "prefix ");
342 TextIO.output (outf, prefix);
343 TextIO.output (outf, "\n");
340 TextIO.output (outf, "\n"); 344 TextIO.output (outf, "\n");
341 345
342 app (fn s => 346 app (fn s =>
343 let 347 let
344 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (), 348 val s = OS.Path.mkAbsolute {relativeTo = OS.FileSys.getDir (),