test_term now handles Match exception raised in generated code.
authorberghofe
Mon, 28 Jul 2003 11:16:38 +0200
changeset 14135 f8a25218b423
parent 14134 0fdf5708c7a8
child 14136 9b7a62788dac
test_term now handles Match exception raised in generated code.
src/Pure/codegen.ML
--- a/src/Pure/codegen.ML	Fri Jul 25 17:21:22 2003 +0200
+++ b/src/Pure/codegen.ML	Mon Jul 28 11:16:38 2003 +0200
@@ -581,7 +581,9 @@
       "\n\nend;\n";
     val _ = use_text Context.ml_output false s;
     fun iter f k = if k > i then None
-      else (case f () of None => iter f (k+1) | Some x => Some x);
+      else (case (f () handle Match =>
+          (warning "Exception Match raised in generated code"; None)) of
+        None => iter f (k+1) | Some x => Some x);
     fun test k = if k > sz then None
       else (priority ("Test data size: " ^ string_of_int k);
         case iter (fn () => !test_fn k) 1 of