summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml11
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 ()