comparison src/main.mlton.sml @ 501:7ef4b2911b09

Some demo improvements
author Adam Chlipala <adamc@hcoop.net>
date Thu, 20 Nov 2008 11:34:36 -0500
parents 2a7e7bd7b29f
children 86ec89baee01
comparison
equal deleted inserted replaced
500:581554f8e642 501:7ef4b2911b09
27 27
28 fun doArgs (args, (timing, demo, sources)) = 28 fun doArgs (args, (timing, demo, sources)) =
29 case args of 29 case args of
30 [] => (timing, demo, rev sources) 30 [] => (timing, demo, rev sources)
31 | "-demo" :: prefix :: rest => 31 | "-demo" :: prefix :: rest =>
32 doArgs (rest, (timing, SOME prefix, sources)) 32 doArgs (rest, (timing, SOME (prefix, false), sources))
33 | "-guided-demo" :: prefix :: rest =>
34 doArgs (rest, (timing, SOME (prefix, true), sources))
33 | arg :: rest => 35 | arg :: rest =>
34 let 36 let
35 val acc = 37 val acc =
36 if size arg > 0 andalso String.sub (arg, 0) = #"-" then 38 if size arg > 0 andalso String.sub (arg, 0) = #"-" then
37 case arg of 39 case arg of
50 [file] => file 52 [file] => file
51 | _ => raise Fail "Zero or multiple job files specified" 53 | _ => raise Fail "Zero or multiple job files specified"
52 54
53 val () = 55 val () =
54 case demo of 56 case demo of
55 SOME prefix => 57 SOME (prefix, guided) =>
56 Demo.make {prefix = prefix, dirname = job} 58 Demo.make {prefix = prefix, dirname = job, guided = guided}
57 | NONE => 59 | NONE =>
58 if timing then 60 if timing then
59 Compiler.time Compiler.toCjrize job 61 Compiler.time Compiler.toCjrize job
60 else 62 else
61 Compiler.compile job 63 Compiler.compile job