comparison src/main.mlton.sml @ 1307:d2ad997ca157

Interface for setting memory limits
author Adam Chlipala <adam@chlipala.net>
date Thu, 14 Oct 2010 11:06:26 -0400
parents 4359e185d3af
children 79557535b843
comparison
equal deleted inserted replaced
1306:3a845f2ce9e9 1307:d2ad997ca157
89 (print (Compiler.moduleOf fname ^ "\n"); 89 (print (Compiler.moduleOf fname ^ "\n");
90 OS.Process.exit OS.Process.success) 90 OS.Process.exit OS.Process.success)
91 | "-noEmacs" :: rest => 91 | "-noEmacs" :: rest =>
92 (Demo.noEmacs := true; 92 (Demo.noEmacs := true;
93 doArgs rest) 93 doArgs rest)
94 | "-limit" :: class :: num :: rest =>
95 (case Int.fromString num of
96 NONE => raise Fail ("Invalid limit number '" ^ num ^ "'")
97 | SOME n =>
98 if n < 0 then
99 raise Fail ("Invalid limit number '" ^ num ^ "'")
100 else
101 Settings.addLimit (class, n);
102 doArgs rest)
94 | arg :: rest => 103 | arg :: rest =>
95 (if size arg > 0 andalso String.sub (arg, 0) = #"-" then 104 (if size arg > 0 andalso String.sub (arg, 0) = #"-" then
96 raise Fail ("Unknown flag " ^ arg) 105 raise Fail ("Unknown flag " ^ arg)
97 else 106 else
98 sources := arg :: !sources; 107 sources := arg :: !sources;