Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/driver/main_args.ml b/driver/main_args.ml
- index 487a929..3d54497 100644
- --- a/driver/main_args.ml
- +++ b/driver/main_args.ml
- @@ -168,6 +168,10 @@ let mk_nodynlink f =
- " Enable optimizations for code that will not be dynlinked"
- ;;
- +let mk_noinit f =
- + "-noinit", Arg.Unit f,
- + " Do not load any init file"
- +
- let mk_nolabels f =
- "-nolabels", Arg.Unit f, " Ignore non-optional labels in types"
- ;;
- @@ -487,6 +491,7 @@ module type Bytetop_options = sig
- val _labels : unit -> unit
- val _no_app_funct : unit -> unit
- val _noassert : unit -> unit
- + val _noinit : unit -> unit
- val _nolabels : unit -> unit
- val _noprompt : unit -> unit
- val _nopromptcont : unit -> unit
- @@ -598,6 +603,7 @@ module type Opttop_options = sig
- val _labels : unit -> unit
- val _no_app_funct : unit -> unit
- val _noassert : unit -> unit
- + val _noinit : unit -> unit
- val _nolabels : unit -> unit
- val _noprompt : unit -> unit
- val _nopromptcont : unit -> unit
- @@ -724,6 +730,7 @@ struct
- mk_labels F._labels;
- mk_no_app_funct F._no_app_funct;
- mk_noassert F._noassert;
- + mk_noinit F._noinit;
- mk_nolabels F._nolabels;
- mk_noprompt F._noprompt;
- mk_nopromptcont F._nopromptcont;
- @@ -841,6 +848,7 @@ module Make_opttop_options (F : Opttop_options) = struct
- mk_labels F._labels;
- mk_no_app_funct F._no_app_funct;
- mk_noassert F._noassert;
- + mk_noinit F._noinit;
- mk_nolabels F._nolabels;
- mk_noprompt F._noprompt;
- mk_nopromptcont F._nopromptcont;
- diff --git a/driver/main_args.mli b/driver/main_args.mli
- index 6d431e7..99c109f 100644
- --- a/driver/main_args.mli
- +++ b/driver/main_args.mli
- @@ -82,6 +82,7 @@ module type Bytetop_options = sig
- val _labels : unit -> unit
- val _no_app_funct : unit -> unit
- val _noassert : unit -> unit
- + val _noinit : unit -> unit
- val _nolabels : unit -> unit
- val _noprompt : unit -> unit
- val _nopromptcont : unit -> unit
- @@ -193,6 +194,7 @@ module type Opttop_options = sig
- val _labels : unit -> unit
- val _no_app_funct : unit -> unit
- val _noassert : unit -> unit
- + val _noinit : unit -> unit
- val _nolabels : unit -> unit
- val _noprompt : unit -> unit
- val _nopromptcont : unit -> unit
- diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml
- index e547bbd..cad72b9 100644
- --- a/toplevel/opttoploop.ml
- +++ b/toplevel/opttoploop.ml
- @@ -387,7 +387,8 @@ let _ =
- ()
- let load_ocamlinit ppf =
- - match !Clflags.init_file with
- + if !Clflags.noinit then ()
- + else match !Clflags.init_file with
- | Some f -> if Sys.file_exists f then ignore (use_silently ppf f)
- else fprintf ppf "Init file not found: \"%s\".@." f
- | None ->
- diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
- index 636fe15..7aea705 100644
- --- a/toplevel/toploop.ml
- +++ b/toplevel/toploop.ml
- @@ -415,7 +415,8 @@ let _ =
- crc_intfs
- let load_ocamlinit ppf =
- - match !Clflags.init_file with
- + if !Clflags.noinit then ()
- + else match !Clflags.init_file with
- | Some f -> if Sys.file_exists f then ignore (use_silently ppf f)
- else fprintf ppf "Init file not found: \"%s\".@." f
- | None ->
- diff --git a/toplevel/topmain.ml b/toplevel/topmain.ml
- index 87c36d1..cc6295e 100644
- --- a/toplevel/topmain.ml
- +++ b/toplevel/topmain.ml
- @@ -65,6 +65,7 @@ module Options = Main_args.Make_bytetop_options (struct
- let dir = Misc.expand_directory Config.standard_library dir in
- include_dirs := dir :: !include_dirs
- let _init s = init_file := Some s
- + let _noinit = set noinit
- let _labels = clear classic
- let _no_app_funct = clear applicative_functors
- let _noassert = set noassert
- diff --git a/utils/clflags.ml b/utils/clflags.ml
- index 4ff808f..7a40afe 100644
- --- a/utils/clflags.ml
- +++ b/utils/clflags.ml
- @@ -42,6 +42,7 @@ and verbose = ref false (* -verbose *)
- and noprompt = ref false (* -noprompt *)
- and nopromptcont = ref false (* -nopromptcont *)
- and init_file = ref (None : string option) (* -init *)
- +and noinit = ref false (* -noinit *)
- and use_prims = ref "" (* -use-prims ... *)
- and use_runtime = ref "" (* -use-runtime ... *)
- and principal = ref false (* -principal *)
- @@ -101,4 +102,3 @@ let shared = ref false (* -shared *)
- let dlcode = ref true (* not -nodynlink *)
- let runtime_variant = ref "";; (* -runtime-variant *)
- -
- diff --git a/utils/clflags.mli b/utils/clflags.mli
- index e671133..ad2ce36 100644
- --- a/utils/clflags.mli
- +++ b/utils/clflags.mli
- @@ -39,6 +39,7 @@ val verbose : bool ref
- val noprompt : bool ref
- val nopromptcont : bool ref
- val init_file : string option ref
- +val noinit : bool ref
- val use_prims : string ref
- val use_runtime : string ref
- val principal : bool ref
Add Comment
Please, Sign In to add comment