daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/driver/main_args.ml b/driver/main_args.ml
  2. index 487a929..3d54497 100644
  3. --- a/driver/main_args.ml
  4. +++ b/driver/main_args.ml
  5. @@ -168,6 +168,10 @@ let mk_nodynlink f =
  6.    " Enable optimizations for code that will not be dynlinked"
  7.  ;;
  8.  
  9. +let mk_noinit f =
  10. +  "-noinit", Arg.Unit f,
  11. +  " Do not load any init file"
  12. +
  13.  let mk_nolabels f =
  14.    "-nolabels", Arg.Unit f, " Ignore non-optional labels in types"
  15.  ;;
  16. @@ -487,6 +491,7 @@ module type Bytetop_options = sig
  17.    val _labels : unit -> unit
  18.    val _no_app_funct : unit -> unit
  19.    val _noassert : unit -> unit
  20. +  val _noinit : unit -> unit
  21.    val _nolabels : unit -> unit
  22.    val _noprompt : unit -> unit
  23.    val _nopromptcont : unit -> unit
  24. @@ -598,6 +603,7 @@ module type Opttop_options = sig
  25.    val _labels : unit -> unit
  26.    val _no_app_funct : unit -> unit
  27.    val _noassert : unit -> unit
  28. +  val _noinit : unit -> unit
  29.    val _nolabels : unit -> unit
  30.    val _noprompt : unit -> unit
  31.    val _nopromptcont : unit -> unit
  32. @@ -724,6 +730,7 @@ struct
  33.      mk_labels F._labels;
  34.      mk_no_app_funct F._no_app_funct;
  35.      mk_noassert F._noassert;
  36. +    mk_noinit F._noinit;
  37.      mk_nolabels F._nolabels;
  38.      mk_noprompt F._noprompt;
  39.      mk_nopromptcont F._nopromptcont;
  40. @@ -841,6 +848,7 @@ module Make_opttop_options (F : Opttop_options) = struct
  41.      mk_labels F._labels;
  42.      mk_no_app_funct F._no_app_funct;
  43.      mk_noassert F._noassert;
  44. +    mk_noinit F._noinit;
  45.      mk_nolabels F._nolabels;
  46.      mk_noprompt F._noprompt;
  47.      mk_nopromptcont F._nopromptcont;
  48. diff --git a/driver/main_args.mli b/driver/main_args.mli
  49. index 6d431e7..99c109f 100644
  50. --- a/driver/main_args.mli
  51. +++ b/driver/main_args.mli
  52. @@ -82,6 +82,7 @@ module type Bytetop_options = sig
  53.    val _labels : unit -> unit
  54.    val _no_app_funct : unit -> unit
  55.    val _noassert : unit -> unit
  56. +  val _noinit : unit -> unit
  57.    val _nolabels : unit -> unit
  58.    val _noprompt : unit -> unit
  59.    val _nopromptcont : unit -> unit
  60. @@ -193,6 +194,7 @@ module type Opttop_options = sig
  61.    val _labels : unit -> unit
  62.    val _no_app_funct : unit -> unit
  63.    val _noassert : unit -> unit
  64. +  val _noinit : unit -> unit
  65.    val _nolabels : unit -> unit
  66.    val _noprompt : unit -> unit
  67.    val _nopromptcont : unit -> unit
  68. diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml
  69. index e547bbd..cad72b9 100644
  70. --- a/toplevel/opttoploop.ml
  71. +++ b/toplevel/opttoploop.ml
  72. @@ -387,7 +387,8 @@ let _ =
  73.    ()
  74.  
  75.  let load_ocamlinit ppf =
  76. -  match !Clflags.init_file with
  77. +  if !Clflags.noinit then ()
  78. +  else match !Clflags.init_file with
  79.    | Some f -> if Sys.file_exists f then ignore (use_silently ppf f)
  80.                else fprintf ppf "Init file not found: \"%s\".@." f
  81.    | None ->
  82. diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml
  83. index 636fe15..7aea705 100644
  84. --- a/toplevel/toploop.ml
  85. +++ b/toplevel/toploop.ml
  86. @@ -415,7 +415,8 @@ let _ =
  87.      crc_intfs
  88.  
  89.  let load_ocamlinit ppf =
  90. -  match !Clflags.init_file with
  91. +  if !Clflags.noinit then ()
  92. +  else match !Clflags.init_file with
  93.    | Some f -> if Sys.file_exists f then ignore (use_silently ppf f)
  94.                else fprintf ppf "Init file not found: \"%s\".@." f
  95.    | None ->
  96. diff --git a/toplevel/topmain.ml b/toplevel/topmain.ml
  97. index 87c36d1..cc6295e 100644
  98. --- a/toplevel/topmain.ml
  99. +++ b/toplevel/topmain.ml
  100. @@ -65,6 +65,7 @@ module Options = Main_args.Make_bytetop_options (struct
  101.      let dir = Misc.expand_directory Config.standard_library dir in
  102.      include_dirs := dir :: !include_dirs
  103.    let _init s = init_file := Some s
  104. +  let _noinit = set noinit
  105.    let _labels = clear classic
  106.    let _no_app_funct = clear applicative_functors
  107.    let _noassert = set noassert
  108. diff --git a/utils/clflags.ml b/utils/clflags.ml
  109. index 4ff808f..7a40afe 100644
  110. --- a/utils/clflags.ml
  111. +++ b/utils/clflags.ml
  112. @@ -42,6 +42,7 @@ and verbose = ref false                 (* -verbose *)
  113.  and noprompt = ref false                (* -noprompt *)
  114.  and nopromptcont = ref false            (* -nopromptcont *)
  115.  and init_file = ref (None : string option)   (* -init *)
  116. +and noinit = ref false                  (* -noinit *)
  117.  and use_prims = ref ""                  (* -use-prims ... *)
  118.  and use_runtime = ref ""                (* -use-runtime ... *)
  119.  and principal = ref false               (* -principal *)
  120. @@ -101,4 +102,3 @@ let shared = ref false (* -shared *)
  121.  let dlcode = ref true (* not -nodynlink *)
  122.  
  123.  let runtime_variant = ref "";;      (* -runtime-variant *)
  124. -
  125. diff --git a/utils/clflags.mli b/utils/clflags.mli
  126. index e671133..ad2ce36 100644
  127. --- a/utils/clflags.mli
  128. +++ b/utils/clflags.mli
  129. @@ -39,6 +39,7 @@ val verbose : bool ref
  130.  val noprompt : bool ref
  131.  val nopromptcont : bool ref
  132.  val init_file : string option ref
  133. +val noinit : bool ref
  134.  val use_prims : string ref
  135.  val use_runtime : string ref
  136.  val principal : bool ref
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top