diff options
| author | Graydon Hoare <[email protected]> | 2010-07-20 13:55:56 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-20 13:55:56 -0700 |
| commit | 62522def7409a233f5316546cd6bee91e812a039 (patch) | |
| tree | 5ac4085ee755b9c83bdd378d6460d4a57ebb0846 /src/boot/util | |
| parent | Re-XFAIL stuff that is definitely still unsupported in LLVM-land (like, throw... (diff) | |
| download | rust-62522def7409a233f5316546cd6bee91e812a039.tar.xz rust-62522def7409a233f5316546cd6bee91e812a039.zip | |
Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2".
Diffstat (limited to 'src/boot/util')
| -rw-r--r-- | src/boot/util/common.ml | 9 |
1 files changed, 8 insertions, 1 deletions
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 = |