Mercurial > urweb
comparison src/compiler.sml @ 1307:d2ad997ca157
Interface for setting memory limits
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 14 Oct 2010 11:06:26 -0400 |
parents | 0d3d9e653829 |
children | e12cef71aa1a |
comparison
equal
deleted
inserted
replaced
1306:3a845f2ce9e9 | 1307:d2ad997ca157 |
---|---|
696 | "onError" => | 696 | "onError" => |
697 (case String.fields (fn ch => ch = #".") arg of | 697 (case String.fields (fn ch => ch = #".") arg of |
698 m1 :: (fs as _ :: _) => | 698 m1 :: (fs as _ :: _) => |
699 onError := SOME (m1, List.take (fs, length fs - 1), List.last fs) | 699 onError := SOME (m1, List.take (fs, length fs - 1), List.last fs) |
700 | _ => ErrorMsg.error "invalid 'onError' argument") | 700 | _ => ErrorMsg.error "invalid 'onError' argument") |
701 | "limit" => | |
702 (case String.fields Char.isSpace arg of | |
703 [class, num] => | |
704 (case Int.fromString num of | |
705 NONE => ErrorMsg.error ("invalid limit number '" ^ num ^ "'") | |
706 | SOME n => | |
707 if n < 0 then | |
708 ErrorMsg.error ("invalid limit number '" ^ num ^ "'") | |
709 else | |
710 Settings.addLimit (class, n)) | |
711 | _ => ErrorMsg.error "invalid 'limit' arguments") | |
701 | 712 |
702 | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); | 713 | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); |
703 read () | 714 read () |
704 end | 715 end |
705 | 716 |