diff --git a/driver/main_args.ml b/driver/main_args.ml index 968fe82af..2c8c8f9c4 100644 --- a/driver/main_args.ml +++ b/driver/main_args.ml @@ -169,6 +169,11 @@ let mk_noprompt f = "-noprompt", Arg.Unit f, " Suppress all prompts" ;; +let mk_nopromptcont f = + "-nopromptcont", Arg.Unit f, + " Suppress prompts for continuation lines of multi-line inputs" +;; + let mk_nostdlib f = "-nostdlib", Arg.Unit f, " Do not add default directory to the list of include directories" @@ -450,6 +455,7 @@ module type Bytetop_options = sig val _noassert : unit -> unit val _nolabels : unit -> unit val _noprompt : unit -> unit + val _nopromptcont : unit -> unit val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit @@ -550,6 +556,7 @@ module type Opttop_options = sig val _noassert : unit -> unit val _nolabels : unit -> unit val _noprompt : unit -> unit + val _nopromptcont : unit -> unit val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit @@ -664,6 +671,7 @@ struct mk_noassert F._noassert; mk_nolabels F._nolabels; mk_noprompt F._noprompt; + mk_nopromptcont F._nopromptcont; mk_nostdlib F._nostdlib; mk_principal F._principal; mk_rectypes F._rectypes; @@ -769,6 +777,7 @@ module Make_opttop_options (F : Opttop_options) = struct mk_noassert F._noassert; mk_nolabels F._nolabels; mk_noprompt F._noprompt; + mk_nopromptcont F._nopromptcont; mk_nostdlib F._nostdlib; mk_principal F._principal; mk_rectypes F._rectypes; diff --git a/driver/main_args.mli b/driver/main_args.mli index 2249ab20c..9e1e84c80 100644 --- a/driver/main_args.mli +++ b/driver/main_args.mli @@ -80,6 +80,7 @@ module type Bytetop_options = sig val _noassert : unit -> unit val _nolabels : unit -> unit val _noprompt : unit -> unit + val _nopromptcont : unit -> unit val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit @@ -180,6 +181,7 @@ module type Opttop_options = sig val _noassert : unit -> unit val _nolabels : unit -> unit val _noprompt : unit -> unit + val _nopromptcont : unit -> unit val _nostdlib : unit -> unit val _principal : unit -> unit val _rectypes : unit -> unit diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml index 1fa5a3fd0..8d83908d0 100644 --- a/toplevel/opttoploop.ml +++ b/toplevel/opttoploop.ml @@ -363,6 +363,7 @@ let refill_lexbuf buffer len = let prompt = if !Clflags.noprompt then "" else if !first_line then "# " + else if !Clflags.nopromptcont then "" else if Lexer.in_comment () then "* " else " " in diff --git a/toplevel/opttopmain.ml b/toplevel/opttopmain.ml index e13bfca4e..ac32a5c10 100644 --- a/toplevel/opttopmain.ml +++ b/toplevel/opttopmain.ml @@ -74,6 +74,7 @@ module Options = Main_args.Make_opttop_options (struct let _noassert = set noassert let _nolabels = set classic let _noprompt = set noprompt + let _nopromptcont = set nopromptcont let _nostdlib = set no_std_include let _principal = set principal let _rectypes = set recursive_types diff --git a/toplevel/toploop.ml b/toplevel/toploop.ml index 3d2f72f20..cff423e7f 100644 --- a/toplevel/toploop.ml +++ b/toplevel/toploop.ml @@ -352,6 +352,7 @@ let refill_lexbuf buffer len = let prompt = if !Clflags.noprompt then "" else if !first_line then "# " + else if !Clflags.nopromptcont then "" else if Lexer.in_comment () then "* " else " " in diff --git a/toplevel/topmain.ml b/toplevel/topmain.ml index d6053e381..27b2ca287 100644 --- a/toplevel/topmain.ml +++ b/toplevel/topmain.ml @@ -71,6 +71,7 @@ module Options = Main_args.Make_bytetop_options (struct let _noassert = set noassert let _nolabels = set classic let _noprompt = set noprompt + let _nopromptcont = set nopromptcont let _nostdlib = set no_std_include let _principal = set principal let _rectypes = set recursive_types diff --git a/utils/clflags.ml b/utils/clflags.ml index ccf75b00e..d9d19c176 100644 --- a/utils/clflags.ml +++ b/utils/clflags.ml @@ -39,6 +39,7 @@ and use_vmthreads = ref false (* -vmthread *) and noassert = ref false (* -noassert *) and verbose = ref false (* -verbose *) and noprompt = ref false (* -noprompt *) +and nopromptcont = ref false (* -nopromptcont *) and init_file = ref (None : string option) (* -init *) and use_prims = ref "" (* -use-prims ... *) and use_runtime = ref "" (* -use-runtime ... *) diff --git a/utils/clflags.mli b/utils/clflags.mli index b08901715..7e6d2a442 100644 --- a/utils/clflags.mli +++ b/utils/clflags.mli @@ -36,6 +36,7 @@ val use_vmthreads : bool ref val noassert : bool ref val verbose : bool ref val noprompt : bool ref +val nopromptcont : bool ref val init_file : string option ref val use_prims : string ref val use_runtime : string ref