diff options
author | Adam Chlipala <adam@chlipala.net> | 2010-10-14 11:06:26 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2010-10-14 11:06:26 -0400 |
commit | 7bf0a0124a6c8a834983a660af53d8789ac0a8ac (patch) | |
tree | 628ead017a0f1cf2138f9f9b08088debf81e1ce5 /src/compiler.sml | |
parent | 4e608544ebe87dd991d53ded5267f14f5df93b8b (diff) |
Interface for setting memory limits
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index bf9bfbdf..038fa0ff 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -698,6 +698,17 @@ fun parseUrp' accLibs fname = m1 :: (fs as _ :: _) => onError := SOME (m1, List.take (fs, length fs - 1), List.last fs) | _ => ErrorMsg.error "invalid 'onError' argument") + | "limit" => + (case String.fields Char.isSpace arg of + [class, num] => + (case Int.fromString num of + NONE => ErrorMsg.error ("invalid limit number '" ^ num ^ "'") + | SOME n => + if n < 0 then + ErrorMsg.error ("invalid limit number '" ^ num ^ "'") + else + Settings.addLimit (class, n)) + | _ => ErrorMsg.error "invalid 'limit' arguments") | _ => ErrorMsg.error ("Unrecognized command '" ^ cmd ^ "'"); read () |