From 62522def7409a233f5316546cd6bee91e812a039 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 20 Jul 2010 13:55:56 -0700 Subject: Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2". --- src/boot/util/common.ml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/boot/util') diff --git a/src/boot/util/common.ml b/src/boot/util/common.ml index 63a4a321..58caf78d 100644 --- a/src/boot/util/common.ml +++ b/src/boot/util/common.ml @@ -26,7 +26,7 @@ let bug _ = ;; (* TODO: On some joyous day, remove me. *) -exception Not_implemented of string +exception Not_implemented of ((node_id option) * string) ;; exception Semant_err of ((node_id option) * string) @@ -39,6 +39,13 @@ let err (idopt:node_id option) = Printf.ksprintf k ;; +let unimpl (idopt:node_id option) = + let k s = + raise (Not_implemented (idopt, "unimplemented " ^ s)) + in + Printf.ksprintf k +;; + (* Some ubiquitous low-level types. *) type target = -- cgit v1.2.3