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/fe/ast.ml | 12 ++++++++++++ src/boot/fe/cexp.ml | 9 +-------- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'src/boot/fe') diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index b70b2b88..76e6e306 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -457,6 +457,18 @@ and crate' = and crate = crate' identified ;; +let empty_crate' = + { crate_items = ({ view_imports = Hashtbl.create 0; + view_exports = Hashtbl.create 0 }, + Hashtbl.create 0); + crate_meta = [||]; + crate_auth = Hashtbl.create 0; + crate_required = Hashtbl.create 0; + crate_required_syms = Hashtbl.create 0; + crate_main = None; + crate_files = Hashtbl.create 0 } +;; + (* * NB: names can only be type-parametric in their *last* path-entry. * All path-entries before that must be ident or idx (non-parametric). diff --git a/src/boot/fe/cexp.ml b/src/boot/fe/cexp.ml index 59904a45..5d3a99ef 100644 --- a/src/boot/fe/cexp.ml +++ b/src/boot/fe/cexp.ml @@ -605,14 +605,7 @@ let with_err_handling sess thunk = (Session.string_of_pos pos) cx) ps.pstate_ctxt; let apos = lexpos ps in - span ps apos apos - { Ast.crate_items = (Item.empty_view, Hashtbl.create 0); - Ast.crate_meta = [||]; - Ast.crate_auth = Hashtbl.create 0; - Ast.crate_required = Hashtbl.create 0; - Ast.crate_required_syms = Hashtbl.create 0; - Ast.crate_main = None; - Ast.crate_files = Hashtbl.create 0 } + span ps apos apos Ast.empty_crate' ;; -- cgit v1.2.3