···192192- GPR#1638: add a Float module.
193193 (Nicolás Ojeda Bär, review by Alain Frisch and Jeremy Yallop)
194194195195-- GPR#1697: Tune [List.init] tailrec threshold so that it does not stack overflow
196196- when compiled with the Js_of_ocaml backend.
195195+- GPR#1697: Tune [List.init] tailrec threshold so that it does not stack
196196+ overflow when compiled with the Js_of_ocaml backend.
197197 (Hugo Heuzard, reviewed by Gabriel Scherer)
198198199199### Other libraries:
···273273- GPR#1618: add the -dno-unique-ids and -dunique-ids compiler flags
274274 (Sébastien Hinderer, review by Leo White and Damien Doligez)
275275276276-- GPR#1649 change compilation order of toplevel definitions, so that some warnings
277277- emitted by the bytecode compiler appear more in-order than before.
276276+- GPR#1649 change compilation order of toplevel definitions, so that some
277277+ warnings emitted by the bytecode compiler appear more in-order than before.
278278 (Luc Maranget, advice and review by Damien Doligez)
279279280280- GPR#1806: add linscan to OCAMLPARAM options
···492492493493- GPR#1513: Allow compilation units to shadow sub-modules of Pervasives.
494494 For instance users can now use a largeFile.ml file in their project.
495495- (Jérémie Dimino, review by Nicolas Ojeda Bar, Alain Frisch and Gabriel Radanne)
495495+ (Jérémie Dimino, review by Nicolas Ojeda Bar, Alain Frisch and Gabriel
496496+ Radanne)
496497497498- GPR#1516: Allow float array construction in recursive bindings
498499 when configured with -no-flat-float-array
···852853 pretty-printing items. New fields have been added to the
853854 formatter_out_functions record, thus this change will break any code building
854855 such record from scratch.
855855- When building Format.formatter_out_functions values redefining the out_spaces field,
856856- "{ fmt_out_funs with out_spaces = f; }" should be replaced by
857857- "{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old behavior.
856856+ When building Format.formatter_out_functions values redefining the out_spaces
857857+ field, "{ fmt_out_funs with out_spaces = f; }" should be replaced by
858858+ "{ fmt_out_funs with out_spaces = f; out_indent = f; }" to maintain the old
859859+ behavior.
858860 (Richard Bonichon and Pierre Weis, review by Alain Frisch, original request by
859861 Spiros Eliopoulos in GPR#506)
860862
+16-8
README.adoc
···11|=====
22| Branch `trunk` | Branch `4.06` | Branch `4.05` | Branch `4.04`
3344-| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",link="https://travis-ci.org/ocaml/ocaml"]
55- image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
66-| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.06["TravisCI Build Status (4.06 branch)",link="https://travis-ci.org/ocaml/ocaml"]
77- image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.06&svg=true["AppVeyor Build Status (4.06 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
88-| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.05["TravisCI Build Status (4.05 branch)",link="https://travis-ci.org/ocaml/ocaml"]
99- image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.05&svg=true["AppVeyor Build Status (4.05 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
1010-| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.04["TravisCI Build Status (4.04 branch)",link="https://travis-ci.org/ocaml/ocaml"]
1111- image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.04&svg=true["AppVeyor Build Status (4.04 branch)",link="https://ci.appveyor.com/project/avsm/ocaml"]
44+| image:https://travis-ci.org/ocaml/ocaml.svg?branch=trunk["TravisCI Build Status (trunk branch)",
55+ link="https://travis-ci.org/ocaml/ocaml"]
66+ image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=trunk&svg=true["AppVeyor Build Status (trunk branch)",
77+ link="https://ci.appveyor.com/project/avsm/ocaml"]
88+| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.06["TravisCI Build Status (4.06 branch)",
99+ link="https://travis-ci.org/ocaml/ocaml"]
1010+ image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.06&svg=true["AppVeyor Build Status (4.06 branch)",
1111+ link="https://ci.appveyor.com/project/avsm/ocaml"]
1212+| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.05["TravisCI Build Status (4.05 branch)",
1313+ link="https://travis-ci.org/ocaml/ocaml"]
1414+ image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.05&svg=true["AppVeyor Build Status (4.05 branch)",
1515+ link="https://ci.appveyor.com/project/avsm/ocaml"]
1616+| image:https://travis-ci.org/ocaml/ocaml.svg?branch=4.04["TravisCI Build Status (4.04 branch)",
1717+ link="https://travis-ci.org/ocaml/ocaml"]
1818+ image:https://ci.appveyor.com/api/projects/status/github/ocaml/ocaml?branch=4.04&svg=true["AppVeyor Build Status (4.04 branch)",
1919+ link="https://ci.appveyor.com/project/avsm/ocaml"]
12201321|=====
1422
+1-1
README.win32.adoc
···96969797|=====
9898| | `cl` Version | Express | SDK/Build Tools
9999-| Visual Studio 2005 | 14.00.x.x | 32-bit only <<vs1,(*)>> |
9999+| Visual Studio 2005 | 14.00.x.x | 32-bit only <<vs1,(*)>> |
100100| Visual Studio 2008 | 15.00.x.x | 32-bit only | Windows SDK 7.0 also provides 32/64-bit compilers
101101| Visual Studio 2010 | 16.00.x.x | 32-bit only | Windows SDK 7.1 also provides 32/64-bit compilers
102102| Visual Studio 2012 | 17.00.x.x | 32/64-bit |
+3-3
asmcomp/arm/reload.ml
···4444 | Iabsf | Inegf when !fpu = Soft ->
4545 (* Soft FP neg and abs also have a "two-address" constraint of sorts.
4646 64-bit floats are represented by pairs of 32-bit integers,
4747- hence there are two arguments and two results.
4848- The code emitter assumes [arg.(0) = res.(0)] but supports
4949- [arg.(1)] and [res.(1)] being in different registers. *)
4747+ hence there are two arguments and two results.
4848+ The code emitter assumes [arg.(0) = res.(0)] but supports
4949+ [arg.(1)] and [res.(1)] being in different registers. *)
5050 res'.(0) <- arg'.(0);
5151 argres'
5252 | _ ->
···113113 (* Remove all overlapping registers from the register mask *)
114114 let remove_bound_overlapping = function
115115 {reg = {loc = Reg r}} as j ->
116116- if (r - r0 < rn) && regmask.(r - r0) && Interval.overlap j i then
116116+ if (r - r0 < rn) && regmask.(r - r0)
117117+ && Interval.overlap j i then
117118 regmask.(r - r0) <- false
118119 | _ -> () in
119120 List.iter remove_bound_overlapping ci.ci_inactive;
+2-1
asmcomp/split.ml
···171171 let previous_exit_subst = !exit_subst in
172172 exit_subst := new_subst @ !exit_subst;
173173 let (new_body, sub_body) = rename body sub in
174174- let res = List.map2 (fun (_, handler) (_, new_subst) -> rename handler !new_subst)
174174+ let res =
175175+ List.map2 (fun (_, handler) (_, new_subst) -> rename handler !new_subst)
175176 handlers new_subst in
176177 exit_subst := previous_exit_subst;
177178 let merged_subst =
+1-1
asmrun/amd64nt.asm
···498498 lea rax, caml_array_bound_error
499499 jmp caml_c_call
500500501501- PUBLIC caml_system__code_end
501501+ PUBLIC caml_system__code_end
502502caml_system__code_end:
503503504504 .DATA
+2-1
bytecomp/bytegen.ml
···554554 (add_pop ndecl cont)))
555555 end else begin
556556 let decl_size =
557557- List.map (fun (id, exp) -> (id, exp, size_of_lambda Ident.empty exp)) decl in
557557+ List.map (fun (id, exp) -> (id, exp, size_of_lambda Ident.empty exp))
558558+ decl in
558559 let rec comp_init new_env sz = function
559560 | [] -> comp_nonrec new_env sz ndecl decl_size
560561 | (id, _exp, RHS_floatblock blocksize) :: rem ->
+2-1
bytecomp/bytegen.mli
···2222val compile_phrase: lambda -> instruction list * instruction list
2323val reset: unit -> unit
24242525-val merge_events : Instruct.debug_event -> Instruct.debug_event -> Instruct.debug_event
2525+val merge_events:
2626+ Instruct.debug_event -> Instruct.debug_event -> Instruct.debug_event
+2-1
bytecomp/bytelink.ml
···619619 let basename = Filename.chop_extension output_name in
620620 let temps = ref [] in
621621 let c_file =
622622- if !Clflags.output_complete_object && not (Filename.check_suffix output_name ".c")
622622+ if !Clflags.output_complete_object
623623+ && not (Filename.check_suffix output_name ".c")
623624 then Filename.temp_file "camlobj" ".c"
624625 else begin
625626 let f = basename ^ ".c" in
+6-3
bytecomp/emitcode.ml
···393940404141let report_error ppf (file, kind) =
4242- Format.fprintf ppf "Generated %s %S cannot be used on a 32-bit platform" kind file
4242+ Format.fprintf ppf "Generated %s %S cannot be used on a 32-bit platform"
4343+ kind file
4344let () =
4445 Location.register_error_of_exn
4546 (function
4646- | Error (Not_compatible_32 info) -> Some (Location.error_of_printer_file report_error info)
4747- | _ -> None
4747+ | Error (Not_compatible_32 info) ->
4848+ Some (Location.error_of_printer_file report_error info)
4949+ | _ ->
5050+ None
4851 )
49525053(* Buffering of bytecode *)
+5-3
bytecomp/emitcode.mli
···2727 required_globals: list of compilation units that must be
2828 evaluated before this one
2929 list of instructions to emit *)
3030-val to_memory: instruction list -> instruction list ->
3131- Misc.LongString.t * (reloc_info * int) list * debug_event list
3030+val to_memory:
3131+ instruction list -> instruction list ->
3232+ Misc.LongString.t * (reloc_info * int) list * debug_event list
3233 (* Arguments:
3334 initialization code (terminated by STOP)
3435 function code
···46474748val reset: unit -> unit
48494949-val marshal_to_channel_with_possibly_32bit_compat : filename:string -> kind:string -> out_channel -> 'a -> unit
5050+val marshal_to_channel_with_possibly_32bit_compat :
5151+ filename:string -> kind:string -> out_channel -> 'a -> unit
-1
bytecomp/meta.mli
···2929 = "caml_invoke_traced_function"
3030external get_section_table : unit -> (string * Obj.t) list
3131 = "caml_get_section_table"
3232-
···102102*/
103103CAMLextern caml_stat_block caml_stat_alloc(asize_t);
104104105105-/* [caml_stat_alloc_noexc(size)] allocates a memory block of the requested [size]
106106- (in bytes) and returns a pointer to it, or NULL in case the request fails.
105105+/* [caml_stat_alloc_noexc(size)] allocates a memory block of the requested
106106+ [size] (in bytes) and returns a pointer to it, or NULL in case the request
107107+ fails.
107108*/
108109CAMLextern caml_stat_block caml_stat_alloc_noexc(asize_t);
109110
···52525353/* Search the given file in the given list of directories.
5454 If not found, return a copy of [name]. */
5555-extern char_os * caml_search_in_path(struct ext_table * path, const char_os * name);
5555+extern char_os * caml_search_in_path(struct ext_table * path,
5656+ const char_os * name);
56575758/* Same, but search an executable name in the system path for executables. */
5859CAMLextern char_os * caml_search_exe_in_path(const char_os * name);
59606061/* Same, but search a shared library in the given path. */
6161-extern char_os * caml_search_dll_in_path(struct ext_table * path, const char_os * name);
6262+extern char_os * caml_search_dll_in_path(struct ext_table * path,
6363+ const char_os * name);
62646365/* Open a shared library and return a handle on it.
6466 If [for_execution] is true, perform full symbol resolution and
···115117116118/* Windows Unicode support */
117119118118-extern int win_multi_byte_to_wide_char(const char* s, int slen, wchar_t *out, int outlen);
119119-extern int win_wide_char_to_multi_byte(const wchar_t* s, int slen, char *out, int outlen);
120120+extern int win_multi_byte_to_wide_char(const char* s,
121121+ int slen,
122122+ wchar_t *out,
123123+ int outlen);
124124+extern int win_wide_char_to_multi_byte(const wchar_t* s,
125125+ int slen,
126126+ char *out,
127127+ int outlen);
120128121129/* [caml_stat_strdup_to_utf16(s)] returns a NULL-terminated copy of [s],
122130 re-encoded in UTF-16. The encoding of [s] is assumed to be UTF-8 if
+1-1
byterun/compact.c
···333333 }else{
334334 CAMLassert (Ecolor (q) == 3);
335335 /* This is guaranteed only if caml_compact_heap was called after a
336336- nonincremental major GC: CAMLassert (Tag_ehd (q) == String_tag);
336336+ nonincremental major GC: CAMLassert (Tag_ehd (q) == String_tag);
337337 */
338338 /* No pointers to the header and no infix header:
339339 the object was free. */
···231231}
232232233233/* auxillary function of mark_slice */
234234-static inline value* mark_slice_darken(value *gray_vals_ptr,
234234+static inline value* mark_slice_darken(value *gray_vals_ptr,
235235 value v, mlsize_t i,
236236 int in_ephemeron, int *slice_pointers)
237237{
+3-1
byterun/meta.c
···8585 CAMLreturnT (char*, ret);
8686}
87878888-CAMLprim value caml_reify_bytecode(value ls_prog, value debuginfo, value digest_opt)
8888+CAMLprim value caml_reify_bytecode(value ls_prog,
8989+ value debuginfo,
9090+ value digest_opt)
8991{
9092 CAMLparam3(ls_prog, debuginfo, digest_opt);
9193 CAMLlocal3(clos, bytecode, retval);
···342342{
343343 if (argc + 1 >= argvsize) {
344344 argvsize *= 2;
345345- argv = (wchar_t **) caml_stat_resize_noexc(argv, argvsize * sizeof(wchar_t *));
345345+ argv =
346346+ (wchar_t **) caml_stat_resize_noexc(argv, argvsize * sizeof(wchar_t *));
346347 if (argv == NULL) out_of_memory();
347348 }
348349 argv[argc++] = arg;
···380381 wchar_t c = prefix[i - 1];
381382 if (c == L'\\' || c == L'/' || c == L':') { prefix[i] = 0; break; }
382383 }
383383- /* No separator was found, it's a filename pattern without a leading directory. */
384384+ /* No separator was found, it's a filename pattern without a leading
385385+ directory. */
384386 if (i == 0)
385387 prefix[0] = 0;
386388 do {
···828830 the argument string is encoded in the local codepage. */
829831static uintnat windows_unicode_fallback = 1;
830832831831-CAMLexport int win_multi_byte_to_wide_char(const char *s, int slen, wchar_t *out, int outlen)
833833+CAMLexport int win_multi_byte_to_wide_char(const char *s, int slen,
834834+ wchar_t *out, int outlen)
832835{
833836 int retcode;
834837···838841 return 0;
839842840843 if (windows_unicode_enabled != 0) {
841841- retcode = MultiByteToWideChar(CP_UTF8, windows_unicode_strict ? MB_ERR_INVALID_CHARS : 0, s, slen, out, outlen);
844844+ retcode =
845845+ MultiByteToWideChar(CP_UTF8,
846846+ windows_unicode_strict ? MB_ERR_INVALID_CHARS : 0,
847847+ s, slen, out, outlen);
842848 if (retcode == 0 && windows_unicode_fallback != 0)
843849 retcode = MultiByteToWideChar(CP_THREAD_ACP, 0, s, slen, out, outlen);
844850 } else {
···851857 return retcode;
852858}
853859854854-#ifndef WC_ERR_INVALID_CHARS /* For old versions of Windows we simply ignore the flag */
860860+/* For old versions of Windows we simply ignore the flag */
861861+#ifndef WC_ERR_INVALID_CHARS
855862#define WC_ERR_INVALID_CHARS 0
856863#endif
857864858858-CAMLexport int win_wide_char_to_multi_byte(const wchar_t *s, int slen, char *out, int outlen)
865865+CAMLexport int win_wide_char_to_multi_byte(const wchar_t *s, int slen,
866866+ char *out, int outlen)
859867{
860868 int retcode;
861869···865873 return 0;
866874867875 if (windows_unicode_enabled != 0)
868868- retcode = WideCharToMultiByte(CP_UTF8, windows_unicode_strict ? WC_ERR_INVALID_CHARS : 0, s, slen, out, outlen, NULL, NULL);
876876+ retcode =
877877+ WideCharToMultiByte(CP_UTF8,
878878+ windows_unicode_strict ? WC_ERR_INVALID_CHARS : 0,
879879+ s, slen, out, outlen, NULL, NULL);
869880 else
870870- retcode = WideCharToMultiByte(CP_THREAD_ACP, 0, s, slen, out, outlen, NULL, NULL);
881881+ retcode =
882882+ WideCharToMultiByte(CP_THREAD_ACP, 0, s, slen, out, outlen, NULL, NULL);
871883872884 if (retcode == 0)
873885 caml_win32_sys_error(GetLastError());
···881893 value v;
882894883895 slen = wcslen(s);
884884- retcode = win_wide_char_to_multi_byte(s, slen, NULL, 0); /* Do not include final NULL */
896896+ /* Do not include final NULL */
897897+ retcode = win_wide_char_to_multi_byte(s, slen, NULL, 0);
885898 v = caml_alloc_string(retcode);
886899 win_wide_char_to_multi_byte(s, slen, String_val(v), retcode);
887900···963976{
964977 char buffer[1024];
965978 FILE_NAME_INFO * nameinfo = (FILE_NAME_INFO *) buffer;
966966- static tGetFileInformationByHandleEx pGetFileInformationByHandleEx = INVALID_HANDLE_VALUE;
979979+ static tGetFileInformationByHandleEx pGetFileInformationByHandleEx =
980980+ INVALID_HANDLE_VALUE;
967981968982 if (pGetFileInformationByHandleEx == INVALID_HANDLE_VALUE)
969983 pGetFileInformationByHandleEx =
970970- (tGetFileInformationByHandleEx)GetProcAddress(GetModuleHandle(L"KERNEL32.DLL"),
971971- "GetFileInformationByHandleEx");
984984+ (tGetFileInformationByHandleEx)GetProcAddress(
985985+ GetModuleHandle(L"KERNEL32.DLL"), "GetFileInformationByHandleEx");
972986973987 if (pGetFileInformationByHandleEx == NULL)
974988 return 0;
975989976976- /* Get pipe name. GetFileInformationByHandleEx does not NULL-terminate the string, so reduce
977977- the buffer size to allow for adding one. */
978978- if (! pGetFileInformationByHandleEx(hFile, FileNameInfo, buffer, sizeof(buffer) - sizeof(WCHAR)))
990990+ /* Get pipe name. GetFileInformationByHandleEx does not NULL-terminate the
991991+ string, so reduce the buffer size to allow for adding one. */
992992+ if (! pGetFileInformationByHandleEx(hFile,
993993+ FileNameInfo,
994994+ buffer,
995995+ sizeof(buffer) - sizeof(WCHAR)))
979996 return 0;
980997981998 nameinfo->FileName[nameinfo->FileNameLength / sizeof(WCHAR)] = L'\0';
···9831000 /* check if this could be a msys pty pipe ('msys-XXXX-ptyN-XX')
9841001 or a cygwin pty pipe ('cygwin-XXXX-ptyN-XX') */
9851002 if ((wcsstr(nameinfo->FileName, L"msys-") ||
986986- wcsstr(nameinfo->FileName, L"cygwin-")) && wcsstr(nameinfo->FileName, L"-pty"))
10031003+ wcsstr(nameinfo->FileName, L"cygwin-")) &&
10041004+ wcsstr(nameinfo->FileName, L"-pty"))
9871005 return 1;
98810069891007 return 0;
+2-1
config/Makefile.mingw
···115115CFLAGS=-O -mms-bitfields -Wall -Wno-unused -fno-tree-vrp
116116# -fno-tree-vrp is here to try to work around the Skylake/Kaby lake bug,
117117# and only works on GCC 4.2 and later.
118118-CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
118118+CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
119119+ -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
119120OCAMLC_CFLAGS=-O -mms-bitfields
120121121122BYTECCDBGCOMPOPTS=-g
+2-1
config/Makefile.mingw64
···115115CFLAGS=-O -mms-bitfields -Wall -Wno-unused -fno-tree-vrp
116116# -fno-tree-vrp is here to try to work around the Skylake/Kaby lake bug,
117117# and only works on GCC 4.2 and later.
118118-CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
118118+CPPFLAGS=-DCAML_NAME_SPACE -DUNICODE -D_UNICODE \
119119+ -DWINDOWS_UNICODE=$(WINDOWS_UNICODE)
119120OCAMLC_CFLAGS=-O -mms-bitfields
120121121122BYTECCDBGCOMPOPTS=-g
···21822182inf "Directories where OCaml will be installed:"
21832183inf " binaries.................. $bindir"
21842184inf " standard library.......... $libdir"
21852185-inf " manual pages.............. $mandir (with extension .$programs_man_section)"
21852185+inf " manual pages.............. $mandir (with extension" \
21862186+ ".$programs_man_section)"
2186218721872188inf "Configuration for the bytecode compiler:"
21882189inf " C compiler used........... $cc"
+2-1
driver/compenv.ml
···235235236236 | "pp" -> preprocessor := Some v
237237 | "runtime-variant" -> runtime_variant := v
238238- | "open" -> open_modules := List.rev_append (String.split_on_char ',' v) !open_modules
238238+ | "open" ->
239239+ open_modules := List.rev_append (String.split_on_char ',' v) !open_modules
239240 | "cc" -> c_compiler := Some v
240241241242 | "clambda-checks" -> set "clambda-checks" [ clambda_checks ] v
+2-1
driver/compile.ml
···3838 if !Clflags.dump_source then fprintf ppf "%a@." Pprintast.signature ast;
3939 Profile.(record_call typing) (fun () ->
4040 let tsg = Typemod.type_interface sourcefile initial_env ast in
4141- if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
4141+ if !Clflags.dump_typedtree then
4242+ fprintf ppf "%a@." Printtyped.interface tsg;
4243 let sg = tsg.sig_type in
4344 if !Clflags.print_types then
4445 Printtyp.wrap_printing_env ~error:false initial_env (fun () ->
+1-1
driver/main.ml
···109109 let _nopervasives = set nopervasives
110110 let _match_context_rows n = match_context_rows := n
111111 let _dno_unique_ids = unset unique_ids
112112- let _dunique_ids = set unique_ids
112112+ let _dunique_ids = set unique_ids
113113 let _dsource = set dump_source
114114 let _dparsetree = set dump_parsetree
115115 let _dtypedtree = set dump_typedtree
+2-1
driver/optcompile.ml
···3838 if !Clflags.dump_source then fprintf ppf "%a@." Pprintast.signature ast;
3939 Profile.(record_call typing) (fun () ->
4040 let tsg = Typemod.type_interface sourcefile initial_env ast in
4141- if !Clflags.dump_typedtree then fprintf ppf "%a@." Printtyped.interface tsg;
4141+ if !Clflags.dump_typedtree then
4242+ fprintf ppf "%a@." Printtyped.interface tsg;
4243 let sg = tsg.sig_type in
4344 if !Clflags.print_types then
4445 Printtyp.wrap_printing_env ~error:false initial_env (fun () ->
+2-1
driver/optmain.ml
···244244 Clflags.add_arguments __LOC__ (Arch.command_line_options @ Options.list);
245245 Clflags.add_arguments __LOC__
246246 ["-depend", Arg.Unit Makedepend.main_from_option,
247247- "<options> Compute dependencies (use 'ocamlopt -depend -help' for details)"];
247247+ "<options> Compute dependencies \
248248+ (use 'ocamlopt -depend -help' for details)"];
248249 Clflags.parse_arguments anonymous usage;
249250 Compmisc.read_color_env ppf;
250251 if !gprofile && not Config.profiling then
···158158.BI \-plugin \ plugin
159159Dynamically load the code of the given
160160.I plugin
161161-(a .cmo, .cma or .cmxs file) in
161161+(a .cmo, .cma or .cmxs file) in
162162.BR ocamldep (1).
163163The plugin must exist in
164164the same kind of code as the tool (
165165-.BR ocamldep.byte
165165+.BR ocamldep.byte
166166must load bytecode
167167-plugins, while
167167+plugins, while
168168.BR ocamldep.opt
169169must load native code plugins), and
170170extension adaptation is done automatically for .cma files (to .cmxs files
171171-if
171171+if
172172.BR ocamldep (1)
173173is compiled in native code).
174174.TP
+17-10
middle_end/inlining_decision.ml
···541541 let try_inlining =
542542 if self_call then
543543 Don't_try_it S.Not_inlined.Self_call
544544- else if not (E.inlining_allowed env function_decl.closure_origin) then
545545- Don't_try_it S.Not_inlined.Unrolling_depth_exceeded
546544 else
547547- Try_it
545545+ if not (E.inlining_allowed env function_decl.closure_origin) then
546546+ Don't_try_it S.Not_inlined.Unrolling_depth_exceeded
547547+ else
548548+ Try_it
548549 in
549550 match try_inlining with
550551 | Don't_try_it decision -> Original decision
···553554 let body, r =
554555 Inlining_transforms.inline_by_copying_function_body ~env
555556 ~r ~function_body ~lhs_of_application
556556- ~closure_id_being_applied ~specialise_requested ~inline_requested
557557- ~function_decl ~fun_vars ~args ~dbg ~simplify
557557+ ~closure_id_being_applied ~specialise_requested
558558+ ~inline_requested ~function_decl ~fun_vars ~args ~dbg ~simplify
558559 in
559560 let env = E.note_entering_inlined env in
560561 let env =
561562 (* We decrement the unrolling count even if the function is not
562563 recursive to avoid having to check whether or not it is
563564 recursive *)
564564- E.inside_unrolled_function env function_decls.set_of_closures_origin
565565+ E.inside_unrolled_function env
566566+ function_decls.set_of_closures_origin
567567+ in
568568+ let env =
569569+ E.inside_inlined_function env function_decl.closure_origin
565570 in
566566- let env = E.inside_inlined_function env function_decl.closure_origin in
567571 Changed ((simplify env r body), S.Inlined.Classic_mode)
568572 in
569573 let res, decision =
···619623 Inline_and_simplify_aux.initial_inlining_toplevel_threshold
620624 ~round:(E.round env)
621625 else
622622- Inline_and_simplify_aux.initial_inlining_threshold ~round:(E.round env)
626626+ Inline_and_simplify_aux.initial_inlining_threshold
627627+ ~round:(E.round env)
623628 in
624629 let unthrottled_inlining_threshold =
625630 match raw_inlining_threshold with
···680685 let size_from_approximation =
681686 let fun_var = Closure_id.unwrap closure_id_being_applied in
682687 match
683683- Variable.Map.find fun_var (Lazy.force value_set_of_closures.size)
688688+ Variable.Map.find fun_var
689689+ (Lazy.force value_set_of_closures.size)
684690 with
685691 | size -> size
686692 | exception Not_found ->
687693 Misc.fatal_errorf "Approximation does not give a size for the \
688688- function having fun_var %a. value_set_of_closures: %a"
694694+ function having fun_var %a. \
695695+ value_set_of_closures: %a"
689696 Variable.print fun_var
690697 A.print_value_set_of_closures value_set_of_closures
691698 in
+2-2
middle_end/inlining_transforms.ml
···508508 match expr with
509509 | Apply ({ kind = Direct closure_id } as apply) -> begin
510510 match
511511- rewrite_direct_call ~specialised_args ~funs ~direct_call_surrogates
512512- ~state:!state_ref ~closure_id ~apply
511511+ rewrite_direct_call ~specialised_args ~funs
512512+ ~direct_call_surrogates ~state:!state_ref ~closure_id ~apply
513513 with
514514 | None -> expr
515515 | Some (state, expr) ->
···27272828let make n c = { name = n; body = c; hook = None }
29293030-let update action code = { action with body = code }
3030+let update action code = { action with body = code }
31313232let compare a1 a2 = String.compare a1.name a2.name
3333
+1-1
ocamltest/builtin_actions.ml
···5555 let reason = "Could not chidir to \"" ^ cwd ^ "\"" in
5656 let result = Result.fail_with_reason reason in
5757 (result, env)
5858- end)
5858+ end)
59596060let dumpenv = make
6161 "dumpenv"
+10-9
ocamltest/ocaml_actions.ml
···7070let binary_modules backend env =
7171 let extension = Ocaml_backends.module_extension backend in
7272 filelist env Ocaml_variables.binary_modules extension
7373-7373+7474let backend_default_flags env =
7575 get_backend_value_from_env env
7676 Ocaml_variables.ocamlc_default_flags
···384384 Ocaml_compilers.ocamlc_byte
385385386386let setup_ocamlc_opt_build_env =
387387- native_action
387387+ native_action
388388 (mk_compiler_env_setup
389389 "setup-ocamlc.opt-build-env"
390390 Ocaml_compilers.ocamlc_opt)
···414414415415let compile (compiler : Ocaml_compilers.compiler) log env =
416416 let ocamlsrcdir = Ocaml_directories.srcdir () in
417417- match Environments.lookup_nonempty Builtin_variables.commandline env with
417417+ match Environments.lookup_nonempty Builtin_variables.commandline env with
418418 | None ->
419419 begin
420420 match Environments.lookup_nonempty Ocaml_variables.module_ env with
···443443 what (String.concat " " commandline) exit_status) in
444444 (Result.fail_with_reason reason, env)
445445 end
446446-446446+447447(* Compile actions *)
448448449449let ocamlc_byte =
···560560 let what = Printf.sprintf "Running ocamlmklib to produce %s" program in
561561 Printf.fprintf log "%s\n%!" what;
562562 let ocamlc_command =
563563- String.concat " "
563563+ String.concat " "
564564 [
565565 Ocaml_commands.ocamlrun_ocamlc ocamlsrcdir;
566566 Ocaml_flags.stdlib ocamlsrcdir;
···644644 Printf.fprintf log "%s\n%!" what;
645645 let test_build_directory =
646646 Actions_helpers.test_build_directory env in
647647- let compiler_output =
647647+ let compiler_output =
648648 Filename.make_path [test_build_directory; "compiler-output"]
649649 in
650650 let env =
···671671 let testfile_basename = Filename.chop_extension testfile in
672672 let finalise =
673673 if Ocamltest_config.ccomptype="msvc"
674674- then finalise_codegen_msvc
674674+ then finalise_codegen_msvc
675675 else finalise_codegen_cc
676676 in
677677 finalise ocamlsrcdir testfile_basename log env
···977977 Environments.lookup_as_bool
978978 Ocaml_variables.ocaml_script_as_argument env
979979 with
980980- | None -> false
980980+ | None -> false
981981 | Some b -> b
982982 in
983983 let commandline =
···10511051 Ocaml_variables.c_preprocessor, Ocamltest_config.c_preprocessor;
10521052 Ocaml_variables.csc, Ocamltest_config.csc;
10531053 Ocaml_variables.csc_flags, Ocamltest_config.csc_flags;
10541054- Ocaml_variables.shared_library_cflags, Ocamltest_config.shared_library_cflags;
10541054+ Ocaml_variables.shared_library_cflags,
10551055+ Ocamltest_config.shared_library_cflags;
10551056 Ocaml_variables.objext, Ocamltest_config.objext;
10561057 Ocaml_variables.sharedobjext, Ocamltest_config.sharedobjext;
10571058 Ocaml_variables.ocamlc_default_flags,
···28282929let all_modules = make ("all_modules",
3030 "All the modules to compile and link")
3131-3131+3232let binary_modules = make ("binary_modules",
3333 "Additional binary modules to link")
3434···217217 "Extension of shared object files")
218218219219let use_runtime =
220220- Variables.make ( "use_runtime", "Whether the -use-runtime option should be used" )
220220+ Variables.make ("use_runtime",
221221+ "Whether the -use-runtime option should be used" )
221222222223let _ = List.iter register_variable
223224 [
···4848(** Return the size of the graphics window. Coordinates of the screen
4949 pixels range over [0 .. size_x()-1] and [0 .. size_y()-1].
5050 Drawings outside of this rectangle are clipped, without causing
5151- an error. The origin (0,0) is at the lower left corner.
5151+ an error. The origin (0,0) is at the lower left corner.
5252 Some implementation (e.g. X Windows) represent coordinates by
5353 16-bit integers, hence wrong clipping may occur with coordinates
5454 below [-32768] or above [32676]. *)
+2-2
otherlibs/graph/open.c
···374374 if (graphic_failure_exn == NULL) {
375375 graphic_failure_exn = caml_named_value("Graphics.Graphic_failure");
376376 if (graphic_failure_exn == NULL)
377377- caml_invalid_argument("Exception Graphics.Graphic_failure not initialized,"
378378- " must link graphics.cma");
377377+ caml_invalid_argument("Exception Graphics.Graphic_failure not "
378378+ "initialized, must link graphics.cma");
379379 }
380380 sprintf(buffer, fmt, arg);
381381 caml_raise_with_string(*graphic_failure_exn, buffer);
+4-2
otherlibs/systhreads/Makefile
···75757676$(LIBNAME).cma: $(THREADS_BCOBJS)
7777ifeq "$(UNIX_OR_WIN32)" "unix"
7878- $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall $(PTHREAD_CAML_LINK) $^
7878+ $(MKLIB) -o $(LIBNAME) -ocamlc '$(CAMLC)' -cclib -lunix -linkall \
7979+ $(PTHREAD_CAML_LINK) $^
7980# TODO: Figure out why -cclib -lunix is used here.
8081# It may be because of the threadsUnix module which is deprecated.
8182# It may hence be good to figure out whether this module shouldn't be
8283# removed, and then -cclib -lunix arguments.
8384else # Windows
8484- $(MKLIB) -o $(LIBNAME) -ocamlc "$(CAMLC)" -linkall $(PTHREAD_CAML_LINK) $^
8585+ $(MKLIB) -o $(LIBNAME) -ocamlc "$(CAMLC)" -linkall \
8686+ $(PTHREAD_CAML_LINK) $^
8587endif
86888789# See remark above: force static linking of libthreadsnat.a
···8787 value* spacetime_finaliser_trie_root;
8888#endif
8989#else
9090- value * stack_low; /* The execution stack for this thread */
9090+ value * stack_low; /* The execution stack for this thread */
9191 value * stack_high;
9292 value * stack_threshold;
9393- value * sp; /* Saved value of caml_extern_sp for this thread */
9494- value * trapsp; /* Saved value of caml_trapsp for this thread */
9393+ value * sp; /* Saved value of caml_extern_sp for this thread */
9494+ value * trapsp; /* Saved value of caml_trapsp for this thread */
9595 struct caml__roots_block * local_roots; /* Saved value of caml_local_roots */
9696 struct longjmp_buffer * external_raise; /* Saved caml_external_raise */
9797#endif
9898- int backtrace_pos; /* Saved caml_backtrace_pos */
9999- backtrace_slot * backtrace_buffer; /* Saved caml_backtrace_buffer */
100100- value backtrace_last_exn; /* Saved caml_backtrace_last_exn (root) */
9898+ int backtrace_pos; /* Saved caml_backtrace_pos */
9999+ backtrace_slot * backtrace_buffer; /* Saved caml_backtrace_buffer */
100100+ value backtrace_last_exn; /* Saved caml_backtrace_last_exn (root) */
101101};
102102103103typedef struct caml_thread_struct * caml_thread_t;
···676676677677CAMLprim value caml_thread_self(value unit) /* ML */
678678{
679679- if (curr_thread == NULL) caml_invalid_argument("Thread.self: not initialized");
679679+ if (curr_thread == NULL)
680680+ caml_invalid_argument("Thread.self: not initialized");
680681 return curr_thread->descr;
681682}
682683···706707{
707708 struct longjmp_buffer * exit_buf = NULL;
708709709709- if (curr_thread == NULL) caml_invalid_argument("Thread.exit: not initialized");
710710+ if (curr_thread == NULL)
711711+ caml_invalid_argument("Thread.exit: not initialized");
710712711713 /* In native code, we cannot call pthread_exit here because on some
712714 systems this raises a C++ exception, and ocamlopt-generated stack
···629629 (* MPR#7253, MPR#7796: make sure "f" is executed only once *)
630630 let f_already_ran = ref false in
631631 exit_function :=
632632- (fun () ->
632632+ (fun () ->
633633 if not !f_already_ran then begin f_already_ran := true; f() end;
634634 g())
635635
+2-1
otherlibs/threads/unix.ml
···10611061 let (out_read, out_write) = pipe ~cloexec:true () in
10621062 let outchan = out_channel_of_descr out_write in
10631063 try
10641064- open_proc prog args None (Process(inchan, outchan)) out_read in_write stderr;
10641064+ open_proc prog args None
10651065+ (Process(inchan, outchan)) out_read in_write stderr;
10651066 close out_read;
10661067 close in_write;
10671068 (inchan, outchan)
+1-1
otherlibs/unix/access.c
···37373838static int access_permission_table[] = {
3939 R_OK,
4040- W_OK,
4040+ W_OK,
4141#ifdef _WIN32
4242 /* Since there is no concept of execute permission on Windows,
4343 we fall b+ack to the read permission */
+2-1
otherlibs/unix/cstringv.c
···3131 if (! caml_string_is_c_safe(Field(arg, i)))
3232 unix_error(EINVAL, cmdname, Field(arg, i));
3333 res = (char_os **) caml_stat_alloc((size + 1) * sizeof(char_os *));
3434- for (i = 0; i < size; i++) res[i] = caml_stat_strdup_to_os(String_val(Field(arg, i)));
3434+ for (i = 0; i < size; i++)
3535+ res[i] = caml_stat_strdup_to_os(String_val(Field(arg, i)));
3536 res[size] = NULL;
3637 return res;
3738}
···10571057 let outchan = out_channel_of_descr out_write in
10581058 begin
10591059 try
10601060- open_proc prog args None (Process(inchan, outchan)) out_read in_write stderr
10601060+ open_proc prog args None
10611061+ (Process(inchan, outchan)) out_read in_write stderr
10611062 with e ->
10621063 close out_read; close out_write;
10631064 close in_read; close in_write;
+2-1
otherlibs/unix/unix.mli
···821821 @since 4.08.0 *)
822822823823val open_process_args_full :
824824- string -> string array -> string array -> in_channel * out_channel * in_channel
824824+ string -> string array -> string array ->
825825+ in_channel * out_channel * in_channel
825826(** Similar to {!Unix.open_process_args}, but the third argument specifies the
826827 environment passed to the command. The result is a triple of channels
827828 connected respectively to the standard output, standard input, and standard
+2-1
otherlibs/unix/unixLabels.mli
···693693 @since 4.08.0 *)
694694695695val open_process_args_full :
696696- string -> string array -> string array -> in_channel * out_channel * in_channel
696696+ string -> string array -> string array ->
697697+ in_channel * out_channel * in_channel
697698(** Similar to {!Unix.open_process_args}, but the third argument specifies the
698699 environment passed to the command. The result is a triple of channels
699700 connected respectively to the standard output, standard input, and standard
+2-2
otherlibs/win32graph/open.c
···359359 if (graphic_failure_exn == NULL) {
360360 graphic_failure_exn = caml_named_value("Graphics.Graphic_failure");
361361 if (graphic_failure_exn == NULL)
362362- caml_invalid_argument("Exception Graphics.Graphic_failure not initialized, "
363363- "must link graphics.cma");
362362+ caml_invalid_argument("Exception Graphics.Graphic_failure not "
363363+ "initialized, must link graphics.cma");
364364 }
365365 sprintf(buffer, fmt, arg);
366366 caml_raise_with_string(*graphic_failure_exn, buffer);
···401401 Windows call GetFullPathName to do this because we need relative paths to
402402 stay relative. *)
403403let normalize_slashes path =
404404- if String.length path >= 4 && path.[0] = '\\' && path.[1] = '\\' && path.[2] = '?' && path.[3] = '\\' then
404404+ if String.length path >= 4 && path.[0] = '\\' && path.[1] = '\\'
405405+ && path.[2] = '?' && path.[3] = '\\' then
405406 path
406407 else
407407- String.init (String.length path) (fun i -> match path.[i] with '/' -> '\\' | c -> c)
408408+ String.init (String.length path)
409409+ (fun i -> match path.[i] with '/' -> '\\' | c -> c)
408410409411let symlink ?to_dir source dest =
410412 let to_dir =
···579581external socket :
580582 ?cloexec: bool -> socket_domain -> socket_type -> int -> file_descr
581583 = "unix_socket"
582582-let socketpair ?cloexec:_ _dom _ty _proto = invalid_arg "Unix.socketpair not implemented"
584584+let socketpair ?cloexec:_ _dom _ty _proto =
585585+ invalid_arg "Unix.socketpair not implemented"
583586external accept :
584587 ?cloexec: bool -> file_descr -> file_descr * sockaddr = "unix_accept"
585588external bind : file_descr -> sockaddr -> unit = "unix_bind"
···932935 let outchan = out_channel_of_descr out_write in
933936 begin
934937 try
935935- open_proc prog cmdline None (Process(inchan, outchan)) out_read in_write stderr
938938+ open_proc prog cmdline None
939939+ (Process(inchan, outchan)) out_read in_write stderr
936940 with e ->
937941 close out_read; close out_write;
938942 close in_read; close in_write;
···970974 close err_write;
971975 (inchan, outchan, errchan)
972976973973-let open_process_args_in prog args = open_process_cmdline_in prog (make_cmdline args)
974974-let open_process_args_out prog args = open_process_cmdline_out prog (make_cmdline args)
975975-let open_process_args prog args = open_process_cmdline prog (make_cmdline args)
976976-let open_process_args_full prog args = open_process_cmdline_full prog (make_cmdline args)
977977+let open_process_args_in prog args =
978978+ open_process_cmdline_in prog (make_cmdline args)
979979+let open_process_args_out prog args =
980980+ open_process_cmdline_out prog (make_cmdline args)
981981+let open_process_args prog args =
982982+ open_process_cmdline prog (make_cmdline args)
983983+let open_process_args_full prog args =
984984+ open_process_cmdline_full prog (make_cmdline args)
977985978986let open_process_shell fn cmd =
979987 let shell =
+4-2
otherlibs/win32unix/unixsupport.c
···50505151value win_alloc_handle(HANDLE h)
5252{
5353- value res = caml_alloc_custom(&win_handle_ops, sizeof(struct filedescr), 0, 1);
5353+ value res =
5454+ caml_alloc_custom(&win_handle_ops, sizeof(struct filedescr), 0, 1);
5455 Handle_val(res) = h;
5556 Descr_kind_val(res) = KIND_HANDLE;
5657 CRT_fd_val(res) = NO_CRT_FD;
···60616162value win_alloc_socket(SOCKET s)
6263{
6363- value res = caml_alloc_custom(&win_handle_ops, sizeof(struct filedescr), 0, 1);
6464+ value res =
6565+ caml_alloc_custom(&win_handle_ops, sizeof(struct filedescr), 0, 1);
6466 Socket_val(res) = s;
6567 Descr_kind_val(res) = KIND_SOCKET;
6668 CRT_fd_val(res) = NO_CRT_FD;
+7-2
otherlibs/win32unix/utimes.c
···3030 /* There are 11644473600 seconds between 1 January 1601 (the NT Epoch) and 1
3131 * January 1970 (the Unix Epoch). FILETIME is measured in 100ns ticks.
3232 */
3333- u.QuadPart = (ULONGLONG)(unixTime * 10000000.0) + INT64_LITERAL(116444736000000000U);
3333+ u.QuadPart =
3434+ (ULONGLONG)(unixTime * 10000000.0) + INT64_LITERAL(116444736000000000U);
3435 ft->dwLowDateTime = u.LowPart;
3536 ft->dwHighDateTime = u.HighPart;
3637}
···5253 caml_enter_blocking_section();
5354 hFile = CreateFile(wpath,
5455 FILE_WRITE_ATTRIBUTES,
5555- FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
5656+ FILE_SHARE_READ | FILE_SHARE_WRITE,
5757+ NULL,
5858+ OPEN_EXISTING,
5959+ 0,
6060+ NULL);
5661 caml_leave_blocking_section();
5762 caml_stat_free(wpath);
5863 if (hFile == INVALID_HANDLE_VALUE) {
-1
parsing/HACKING.adoc
···66link:location.mli[Location]:: This module contains utilities
77related to locations and error handling. In particular, it contains
88handlers that are used for all the error reporting in the compiler.
99-
+2-1
parsing/ast_mapper.ml
···829829let extension_of_exn exn =
830830 match error_of_exn exn with
831831 | Some (`Ok error) -> extension_of_error error
832832- | Some `Already_displayed -> { loc = Location.none; txt = "ocaml.error" }, PStr []
832832+ | Some `Already_displayed ->
833833+ { loc = Location.none; txt = "ocaml.error" }, PStr []
833834 | None -> raise exn
834835835836
+2-1
parsing/lexer.mll
···226226(* Warn about Latin-1 characters used in idents *)
227227228228let warn_latin1 lexbuf =
229229- Location.deprecated (Location.curr lexbuf)"ISO-Latin1 characters in identifiers"
229229+ Location.deprecated (Location.curr lexbuf)
230230+ "ISO-Latin1 characters in identifiers"
230231231232let handle_docstrings = ref true
232233let comment_list = ref []
+2-1
parsing/location.ml
···1919 (* This reference should be in Clflags, but it would create an additional
2020 dependency and make bootstrapping Camlp4 more difficult. *)
21212222-type t = Warnings.loc = { loc_start: position; loc_end: position; loc_ghost: bool };;
2222+type t = Warnings.loc =
2323+ { loc_start: position; loc_end: position; loc_ghost: bool };;
23242425let in_file name =
2526 let loc = {
+6-3
parsing/parser.mly
···11941194 post_item_attributes
11951195 {
11961196 let (p, v) = $3 in
11971197- mkctf (Pctf_method (mkrhs $4 4, p, v, $6)) ~attrs:($2@$7) ~docs:(symbol_docs ())
11971197+ mkctf (Pctf_method (mkrhs $4 4, p, v, $6))
11981198+ ~attrs:($2@$7) ~docs:(symbol_docs ())
11981199 }
11991200 | CONSTRAINT attributes constrain_field post_item_attributes
12001201 { mkctf (Pctf_constraint $3) ~attrs:($2@$4) ~docs:(symbol_docs ()) }
···23432344 | core_type_list STAR simple_core_type { $3 :: $1 }
23442345;
23452346meth_list:
23462346- field_semi meth_list { let (f, c) = $2 in ($1 :: f, c) }
23472347- | inherit_field_semi meth_list { let (f, c) = $2 in ($1 :: f, c) }
23472347+ field_semi meth_list
23482348+ { let (f, c) = $2 in ($1 :: f, c) }
23492349+ | inherit_field_semi meth_list
23502350+ { let (f, c) = $2 in ($1 :: f, c) }
23482351 | field_semi { [$1], Closed }
23492352 | field { [$1], Closed }
23502353 | inherit_field_semi { [$1], Closed }
+2-1
parsing/pprintast.ml
···779779 pp f "@[<2>[%%%%%s@ %a]@]" s.txt (payload ctxt) e
780780781781and exception_declaration ctxt f x =
782782- pp f "@[<hov2>exception@ %a@]%a" (extension_constructor ctxt) x.ptyexn_constructor
782782+ pp f "@[<hov2>exception@ %a@]%a"
783783+ (extension_constructor ctxt) x.ptyexn_constructor
783784 (item_attributes ctxt) x.ptyexn_attributes
784785785786and class_signature ctxt f { pcsig_self = ct; pcsig_fields = l ;_} =
···3838 function with each remaining argument *)
3939 | Expand of (string -> string array) (* If the remaining arguments to process
4040 are of the form
4141- [["-foo"; "arg"] @ rest] where "foo" is
4242- registered as [Expand f], then the
4141+ [["-foo"; "arg"] @ rest] where "foo"
4242+ is registered as [Expand f], then the
4343 arguments [f "arg" @ rest] are
4444 processed. Only allowed in
4545 [parse_and_expand_argv_dynamic]. *)
···129129 try Some (float_of_string x)
130130 with Failure _ -> None
131131132132-let parse_and_expand_argv_dynamic_aux allow_expand current argv speclist anonfun errmsg =
132132+let parse_and_expand_argv_dynamic_aux allow_expand current argv speclist anonfun
133133+ errmsg =
133134 let initpos = !current in
134135 let convert_error error =
135136 (* convert an internal error to a Bad/Help exception
···137138 to an user-raised Bad exception.
138139 *)
139140 let b = Buffer.create 200 in
140140- let progname = if initpos < (Array.length !argv) then !argv.(initpos) else "(?)" in
141141+ let progname =
142142+ if initpos < (Array.length !argv) then !argv.(initpos) else "(?)" in
141143 begin match error with
142144 | Unknown "-help" -> ()
143145 | Unknown "--help" -> ()
···249251 done;
250252 | Expand f ->
251253 if not allow_expand then
252252- raise (Invalid_argument "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic");
254254+ raise (Invalid_argument "Arg.Expand is is only allowed with \
255255+ Arg.parse_and_expand_argv_dynamic");
253256 let arg = get_arg () in
254257 let newarg = f arg in
255258 consume_arg ();
256259 let before = Array.sub !argv 0 (!current + 1)
257257- and after = Array.sub !argv (!current + 1) ((Array.length !argv) - !current - 1) in
260260+ and after =
261261+ Array.sub !argv (!current + 1)
262262+ ((Array.length !argv) - !current - 1) in
258263 argv:= Array.concat [before;newarg;after];
259264 in
260265 treat_action action end
···269274 parse_and_expand_argv_dynamic_aux true current argv speclist anonfun errmsg
270275271276let parse_argv_dynamic ?(current=current) argv speclist anonfun errmsg =
272272- parse_and_expand_argv_dynamic_aux false current (ref argv) speclist anonfun errmsg
277277+ parse_and_expand_argv_dynamic_aux false current (ref argv) speclist anonfun
278278+ errmsg
273279274280275281let parse_argv ?(current=current) argv speclist anonfun errmsg =
+4-4
stdlib/arg.mli
···6161 function with each remaining argument *)
6262 | Expand of (string -> string array) (** If the remaining arguments to process
6363 are of the form
6464- [["-foo"; "arg"] @ rest] where "foo" is
6565- registered as [Expand f], then the
6464+ [["-foo"; "arg"] @ rest] where "foo"
6565+ is registered as [Expand f], then the
6666 arguments [f "arg" @ rest] are
6767 processed. Only allowed in
6868 [parse_and_expand_argv_dynamic]. *)
···189189 @since 4.05.0 *)
190190191191val read_arg0: string -> string array
192192-(** Identical to {!Arg.read_arg} but assumes null character terminated command line
193193- arguments.
192192+(** Identical to {!Arg.read_arg} but assumes null character terminated command
193193+ line arguments.
194194 @since 4.05.0 *)
195195196196
···177177val of_seq : char Seq.t -> t
178178(** Create a buffer from the generator
179179 @since 4.07 *)
180180-
+4-3
stdlib/bytes.ml
···261261(* duplicated in string.ml *)
262262let index_from_opt s i c =
263263 let l = length s in
264264- if i < 0 || i > l then invalid_arg "String.index_from_opt / Bytes.index_from_opt" else
265265- index_rec_opt s l i c
264264+ if i < 0 || i > l then
265265+ invalid_arg "String.index_from_opt / Bytes.index_from_opt"
266266+ else
267267+ index_rec_opt s l i c
266268267269(* duplicated in string.ml *)
268270let rec rindex_rec s i c =
···366368 incr n)
367369 i;
368370 sub !buf 0 !n
369369-
+2-1
stdlib/bytes.mli
···219219220220val index_from_opt: bytes -> int -> char -> int option
221221(** [index_from _opts i c] returns the index of the first occurrence of
222222- byte [c] in [s] after position [i] or [None] if [c] does not occur in [s] after position [i].
222222+ byte [c] in [s] after position [i] or [None] if [c] does not occur in [s]
223223+ after position [i].
223224 [Bytes.index_opt s c] is equivalent to [Bytes.index_from_opt s 0 c].
224225225226 Raise [Invalid_argument] if [i] is not a valid position in [s].
+2-1
stdlib/bytesLabels.mli
···193193194194val index_from_opt: bytes -> int -> char -> int option
195195(** [index_from _opts i c] returns the index of the first occurrence of
196196- byte [c] in [s] after position [i] or [None] if [c] does not occur in [s] after position [i].
196196+ byte [c] in [s] after position [i] or [None] if [c] does not occur in [s]
197197+ after position [i].
197198 [Bytes.index_opt s c] is equivalent to [Bytes.index_from_opt s 0 c].
198199199200 Raise [Invalid_argument] if [i] is not a valid position in [s].
+17-10
stdlib/camlinternalFormat.ml
···281281282282(* Convert an integer conversion to char. *)
283283let char_of_iconv iconv = match iconv with
284284- | Int_d | Int_pd | Int_sd | Int_Cd -> 'd' | Int_i | Int_pi | Int_si | Int_Ci -> 'i'
285285- | Int_x | Int_Cx -> 'x' | Int_X | Int_CX -> 'X' | Int_o | Int_Co -> 'o'
286286- | Int_u | Int_Cu -> 'u'
284284+ | Int_d | Int_pd | Int_sd | Int_Cd -> 'd' | Int_i | Int_pi | Int_si
285285+ | Int_Ci -> 'i' | Int_x | Int_Cx -> 'x' | Int_X | Int_CX -> 'X' | Int_o
286286+ | Int_Co -> 'o' | Int_u | Int_Cu -> 'u'
287287288288(* Convert a float conversion to char. *)
289289let char_of_fconv fconv = match fconv with
···407407let bprint_iconv_flag buf iconv = match iconv with
408408 | Int_pd | Int_pi -> buffer_add_char buf '+'
409409 | Int_sd | Int_si -> buffer_add_char buf ' '
410410- | Int_Cx | Int_CX | Int_Co | Int_Cd | Int_Ci | Int_Cu -> buffer_add_char buf '#'
410410+ | Int_Cx | Int_CX | Int_Co | Int_Cd | Int_Ci | Int_Cu ->
411411+ buffer_add_char buf '#'
411412 | Int_d | Int_i | Int_x | Int_X | Int_o | Int_u -> ()
412413413414(* Print an complete int format in a buffer (ex: "%3.*d"). *)
···885886886887 | Char rest -> Char_ty (fmtty_of_fmt rest)
887888 | Caml_char rest -> Char_ty (fmtty_of_fmt rest)
888888- | Bool (pad, rest) -> fmtty_of_padding_fmtty pad (Bool_ty (fmtty_of_fmt rest))
889889+ | Bool (pad, rest) ->
890890+ fmtty_of_padding_fmtty pad (Bool_ty (fmtty_of_fmt rest))
889891 | Alpha rest -> Alpha_ty (fmtty_of_fmt rest)
890892 | Theta rest -> Theta_ty (fmtty_of_fmt rest)
891893 | Custom (arity, _, rest) -> fmtty_of_custom arity (fmtty_of_fmt rest)
···14351437 let left = ref ((digits - 1) mod 3 + 1) in
14361438 for i = 0 to String.length s - 1 do
14371439 match String.unsafe_get s i with
14381438- | '0'..'9' as c -> if !left = 0 then (put '_'; left := 3); decr left; put c
14401440+ | '0'..'9' as c ->
14411441+ if !left = 0 then (put '_'; left := 3); decr left; put c
14391442 | c -> put c
14401443 done;
14411444 Bytes.unsafe_to_string buf
14421445 | _ -> s
1443144614441447(* Convert an integer to a string according to a conversion. *)
14451445-let convert_int iconv n = transform_int_alt iconv (format_int (format_of_iconv iconv) n)
14461446-let convert_int32 iconv n = transform_int_alt iconv (format_int32 (format_of_iconvl iconv) n)
14471447-let convert_nativeint iconv n = transform_int_alt iconv (format_nativeint (format_of_iconvn iconv) n)
14481448-let convert_int64 iconv n = transform_int_alt iconv (format_int64 (format_of_iconvL iconv) n)
14481448+let convert_int iconv n =
14491449+ transform_int_alt iconv (format_int (format_of_iconv iconv) n)
14501450+let convert_int32 iconv n =
14511451+ transform_int_alt iconv (format_int32 (format_of_iconvl iconv) n)
14521452+let convert_nativeint iconv n =
14531453+ transform_int_alt iconv (format_nativeint (format_of_iconvn iconv) n)
14541454+let convert_int64 iconv n =
14551455+ transform_int_alt iconv (format_int64 (format_of_iconvL iconv) n)
1449145614501457(* Convert a float to string. *)
14511458(* Fix special case of "OCaml float format". *)
+2-1
stdlib/float.ml
···8787type t = float
8888external compare : float -> float -> int = "%compare"
8989let equal x y = compare x y = 0
9090-external seeded_hash_param : int -> int -> int -> float -> int = "caml_hash" [@@noalloc]
9090+external seeded_hash_param : int -> int -> int -> float -> int
9191+ = "caml_hash" [@@noalloc]
9192let hash x = seeded_hash_param 10 100 0 x
92939394module Array = struct
···128128129129external of_string : string -> int32 = "caml_int32_of_string"
130130(** Convert the given string to a 32-bit integer.
131131- The string is read in decimal (by default, or if the string
131131+ The string is read in decimal (by default, or if the string
132132 begins with [0u]) or in hexadecimal, octal or binary if the
133133 string begins with [0x], [0o] or [0b] respectively.
134134
+1-1
stdlib/int64.mli
···150150151151external of_string : string -> int64 = "caml_int64_of_string"
152152(** Convert the given string to a 64-bit integer.
153153- The string is read in decimal (by default, or if the string
153153+ The string is read in decimal (by default, or if the string
154154 begins with [0u]) or in hexadecimal, octal or binary if the
155155 string begins with [0x], [0o] or [0b] respectively.
156156
+4-2
stdlib/map.ml
···351351 match (l, r) with
352352 (Empty, _) -> add_min_binding v d r
353353 | (_, Empty) -> add_max_binding v d l
354354- | (Node{l=ll; v=lv; d=ld; r=lr; h=lh}, Node{l=rl; v=rv; d=rd; r=rr; h=rh}) ->
354354+ | (Node{l=ll; v=lv; d=ld; r=lr; h=lh},
355355+ Node{l=rl; v=rv; d=rd; r=rr; h=rh}) ->
355356 if lh > rh + 2 then bal ll lv ld (join lr v d r) else
356357 if rh > lh + 2 then bal (join l v d rl) rv rd rr else
357358 create l v d r
···399400 let rec union f s1 s2 =
400401 match (s1, s2) with
401402 | (Empty, s) | (s, Empty) -> s
402402- | (Node {l=l1; v=v1; d=d1; r=r1; h=h1}, Node {l=l2; v=v2; d=d2; r=r2; h=h2}) ->
403403+ | (Node {l=l1; v=v1; d=d1; r=r1; h=h1},
404404+ Node {l=l2; v=v2; d=d2; r=r2; h=h2}) ->
403405 if h1 >= h2 then
404406 let (l2, d2, r2) = split v1 s2 in
405407 let l = union f l1 l2 and r = union f r1 r2 in
+1-1
stdlib/nativeint.mli
···158158159159external of_string : string -> nativeint = "caml_nativeint_of_string"
160160(** Convert the given string to a native integer.
161161- The string is read in decimal (by default, or if the string
161161+ The string is read in decimal (by default, or if the string
162162 begins with [0u]) or in hexadecimal, octal or binary if the
163163 string begins with [0x], [0o] or [0b] respectively.
164164
···9696val of_seq : 'a Seq.t -> 'a t
9797(** Create an array from the generator
9898 @since 4.07 *)
9999-
+10-5
stdlib/seq.mli
···5353val filter : ('a -> bool) -> 'a t -> 'a t
5454(** Remove from the sequence the elements that do not satisfy the
5555 given predicate.
5656- This transformation is lazy, it only applies when the result is traversed. *)
5656+ This transformation is lazy, it only applies when the result is
5757+ traversed. *)
57585859val filter_map : ('a -> 'b option) -> 'a t -> 'b t
5960(** Apply the function to every element; if [f x = None] then [x] is dropped;
6061 if [f x = Some y] then [y] is returned.
6161- This transformation is lazy, it only applies when the result is traversed. *)
6262+ This transformation is lazy, it only applies when the result is
6363+ traversed. *)
62646365val flat_map : ('a -> 'b t) -> 'a t -> 'b t
6466(** Map each element to a subsequence, then return each element of this
6567 sub-sequence in turn.
6666- This transformation is lazy, it only applies when the result is traversed. *)
6868+ This transformation is lazy, it only applies when the result is
6969+ traversed. *)
67706871val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
6972(** Traverse the sequence from left to right, combining each element with the
7073 accumulator using the given function.
7171- The traversal happens immediately and will not terminate on infinite sequences.
7474+ The traversal happens immediately and will not terminate on infinite
7575+ sequences.
72767377 Also see {!List.fold_left} *)
74787579val iter : ('a -> unit) -> 'a t -> unit
7680(** Iterate on the sequence, calling the (imperative) function on every element.
7777- The traversal happens immediately and will not terminate on infinite sequences. *)
8181+ The traversal happens immediately and will not terminate on infinite
8282+ sequences. *)
-1
stdlib/stack.ml
···5353 let s = create() in
5454 add_seq s g;
5555 s
5656-
-1
stdlib/stack.mli
···7676val of_seq : 'a Seq.t -> 'a t
7777(** Create a stack from the iterator
7878 @since 4.07 *)
7979-
+1-1
stdlib/stdlib.ml
···541541 (* MPR#7253, MPR#7796: make sure "f" is executed only once *)
542542 let f_already_ran = ref false in
543543 exit_function :=
544544- (fun () ->
544544+ (fun () ->
545545 if not !f_already_ran then begin f_already_ran := true; f() end;
546546 g())
547547
+6-4
stdlib/string.ml
···104104 let rec escape_if_needed s n i =
105105 if i >= n then s else
106106 match unsafe_get s i with
107107- | '\"' | '\\' | '\000'..'\031' | '\127'.. '\255' -> bts (B.escaped (bos s))
107107+ | '\"' | '\\' | '\000'..'\031' | '\127'.. '\255' ->
108108+ bts (B.escaped (bos s))
108109 | _ -> escape_if_needed s n (i+1)
109110 in
110111 escape_if_needed s (length s) 0
···134135(* duplicated in bytes.ml *)
135136let index_from_opt s i c =
136137 let l = length s in
137137- if i < 0 || i > l then invalid_arg "String.index_from_opt / Bytes.index_from_opt" else
138138- index_rec_opt s l i c
138138+ if i < 0 || i > l then
139139+ invalid_arg "String.index_from_opt / Bytes.index_from_opt"
140140+ else
141141+ index_rec_opt s l i c
139142140143(* duplicated in bytes.ml *)
141144let rec rindex_rec s i c =
···228231let to_seqi s = bos s |> B.to_seqi
229232230233let of_seq g = B.of_seq g |> bts
231231-
+23-4
testsuite/HACKING.adoc
···4455== Useful Makefile targets
6677-`make parallel`:: runs the tests in parallel using the link:https://www.gnu.org/software/parallel/[GNU parallel] tool: tests run twice as fast with no difference in output order.
77+`make parallel`::
88+ runs the tests in parallel using the
99+ link:https://www.gnu.org/software/parallel/[GNU parallel] tool: tests run
1010+ twice as fast with no difference in output order.
81199-`make all-foo`, `make parallel-foo`:: runs only the tests in the directories whose name starts with `foo`: `parallel-typing`, `all-lib`, etc.
1212+`make all-foo`, `make parallel-foo`::
1313+ runs only the tests in the directories whose name starts with `foo`:
1414+ `parallel-typing`, `all-lib`, etc.
10151111-`make one DIR=tests/foo`:: runs only the tests in the directory `tests/foo`. This is often equivalent to `cd tests/foo && make`, but sometimes the latter breaks the test makefile if it contains fragile relative filesystem paths. Such errors should be fixed if you find them, but `make one DIR=...` is the more reliable option as it runs exactly as `make all` which is heavily tested.
1616+`make one DIR=tests/foo`::
1717+ runs only the tests in the directory `tests/foo`. This is often equivalent to
1818+ `cd tests/foo && make`, but sometimes the latter breaks the test makefile if
1919+ it contains fragile relative filesystem paths. Such errors should be fixed if
2020+ you find them, but `make one DIR=...` is the more reliable option as it runs
2121+ exactly as `make all` which is heavily tested.
12221313-`make promote DIR=tests/foo`:: most test run a program and compare the result of the program, store in a file `foo.result`, with a reference output stored in `foo.reference` -- the test fails if the two output differ. Sometimes a change in result is innocuous, it comes from an intended change in output instead of a regression. `make promote` copies the new result file into the reference file, making the test pass again. Whenever you use this rule please check carefully, using `git diff`, that the change really corresponds to an intended output difference, and not to a regression. You then need to commit the change to reference file, and your commit message should explain why the output changed.
2323+`make promote DIR=tests/foo`::
2424+ most test run a program and compare the result of the program, store in a file
2525+ `foo.result`, with a reference output stored in `foo.reference` -- the test
2626+ fails if the two output differ. Sometimes a change in result is innocuous, it
2727+ comes from an intended change in output instead of a regression.
2828+ `make promote` copies the new result file into the reference file, making the
2929+ test pass again. Whenever you use this rule please check carefully, using
3030+ `git diff`, that the change really corresponds to an intended output
3131+ difference, and not to a regression. You then need to commit the change to
3232+ reference file, and your commit message should explain why the output changed.
···1919 let g () = (a, fst b) in
2020 assert (g () == ((1,2), (1,2)));
2121 assert (fst (pair a a) == (1, 2));
2222- assert (snd b != ["x"; "y"] || Config.safe_string); (* mutable "constant", cannot be shared *)
2222+ assert (snd b != ["x"; "y"] || Config.safe_string); (* mutable "constant",
2323+ cannot be shared *)
2324 let x2 = Gc.allocated_bytes () in
2425 assert(x1 -. x0 = x2 -. x1)
2526 (* check that we did not allocated anything between x1 and x2 *)
+1-1
testsuite/tests/asmgen/even-odd.cmm
···1111 (exit even (- v 1)))
1212 and (even v)
1313 (if (== v 0) 1
1414- (exit odd (- v 1)))))1414+ (exit odd (- v 1)))))
+1-1
testsuite/tests/asmgen/pgcd.cmm
···1212 (if (== n 0)
1313 m
1414 (let (r (mod m n))
1515- (exit pgcd r n))))))1515+ (exit pgcd r n))))))
···77 in fun q -> fun i -> "") (print_endline "x")
8899let _ =
1010- let k =
1111- (let _i = print_int 1
1212- in fun q -> fun i -> "") ()
1010+ let k =
1111+ (let _i = print_int 1
1212+ in fun q -> fun i -> "") ()
1313 in k (print_int 0)
14141515let () =
···5454 List.iter (function (k, f) ->
5555 let m1 = update i f m in
5656 let m2 = IntMap.update i f m in
5757- if not (IntMap.equal ( = ) m1 m2 && ((m1 == m) = (m2 == m))) then begin
5757+ if not (IntMap.equal ( = ) m1 m2 && ((m1 == m) = (m2 == m))) then
5858+ begin
5859 Printf.printf "ERROR: %s: %d -> %d\n" k i j;
5960 print_endline "expected result:";
6061 show m1;
···6364 end
6465 )
6566 [
6666- "replace", (function None -> None | Some _ -> Some j);
6767- "delete if exists, bind otherwise", (function None -> Some j | Some _ -> None);
6868- "delete", (function None -> None | Some _ -> None);
6969- "insert", (function None -> Some j | Some _ -> Some j);
6767+ "replace", (function None -> None | Some _ -> Some j);
6868+ "delete if exists, bind otherwise",
6969+ (function None -> Some j | Some _ -> None);
7070+ "delete", (function None -> None | Some _ -> None);
7171+ "insert", (function None -> Some j | Some _ -> Some j);
7072 ]
7173 done;
7274 done;
···1010 for n = 1 to 1000 do
1111 let open Complex in
1212 let c = { re = float n; im = 0. } in
1313- (* The following line triggers warning 55 twice when compiled without flambda *)
1414- (* It would be better to disable this warning just here but since *)
1515- (* this is a backend-warning, this is not currently possible *)
1616- (* Hence the use of the -w-55 command-line flag for this test *)
1313+ (* The following line triggers warning 55 twice when compiled without
1414+ flambda. It would be better to disable this warning just here but since
1515+ this is a backend-warning, this is not currently possible. Hence the use
1616+ of the -w-55 command-line flag for this test *)
1717 r := !r +. (norm [@inlined]) ((add [@inlined]) c i);
1818 done;
1919 ignore (Sys.opaque_identity !r)
+1-2
testsuite/tests/letrec-disallowed/disallowed.ml
···110110let rec x =
111111 match let _ = y in raise Not_found with
112112 _ -> "x"
113113- | exception Not_found -> "z"
113113+ | exception Not_found -> "z"
114114and y = match x with
115115 z -> ("y", z);;
116116-
···120120Characters 15-98:
121121 ..match let _ = y in raise Not_found with
122122 _ -> "x"
123123- | exception Not_found -> "z".
123123+ | exception Not_found -> "z"
124124Error: This kind of expression is not allowed as right-hand side of `let rec'
125125
···11-Characters 39-45:
11+Characters 38-44:
22 let rec a = lazy b and b = 3;;
33 ^^^^^^
44Error: This kind of expression is not allowed as right-hand side of `let rec'
+1-1
testsuite/tests/letrec-disallowed/pr7231.ml
···22 * toplevel
33*)
4455-let rec r = let rec x () = r and y () = x () in y () in r "oops";;
55+let rec r = let rec x () = r and y () = x () in y () in r "oops";;
···11Characters 84-90:
22- let rec r = let rec x () = r and y () = x () in y () in r "oops";;
22+ let rec r = let rec x () = r and y () = x () in y () in r "oops";;
33 ^^^^^^
44Warning 20: this argument will not be used by the function.
55Characters 38-78:
66- let rec r = let rec x () = r and y () = x () in y () in r "oops";;
66+ let rec r = let rec x () = r and y () = x () in y () in r "oops";;
77 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88Error: This kind of expression is not allowed as right-hand side of `let rec'
99
+1-1
testsuite/tests/letrec-disallowed/unboxed.ml
···7788type r = A of r [@@unboxed];;
99let rec y = A y;;
1010-1010+1111type a = {a: b }[@@unboxed]
1212and b = X of a | Y
1313
···88 let rec y = A y;;
99 ^^^
1010Error: This kind of expression is not allowed as right-hand side of `let rec'
1111-Characters 77-150:
1111+Characters 63-136:
1212 ..{a=
1313 (if Sys.opaque_identity true then
1414 X a
+2-1
testsuite/tests/letrec/ref.ml
···11(* TEST *)
2233-(* Test construction of cyclic values where the cycles pass through references *)
33+(* Test construction of cyclic values where the cycles pass through
44+ references *)
4556type t = { mutable next : t; mutable inst : n ref }
67and n = T of t
+2-1
testsuite/tests/lib-arg/testarg.ml
···195195 let spec =
196196 [
197197 "-foo", Arg.String ignore, "FOO Do foo with FOO";
198198- "-bar", Arg.Tuple [Arg.String ignore; Arg.String ignore], "FOO BAR\tDo bar with FOO and BAR";
198198+ "-bar", Arg.Tuple [Arg.String ignore; Arg.String ignore],
199199+ "FOO BAR\tDo bar with FOO and BAR";
199200 "-cha", Arg.Unit ignore, " Another option";
200201 "-sym", Arg.Symbol (["a"; "b"], ignore), "\ty\tfoo";
201202 "-sym2", Arg.Symbol (["a"; "b"], ignore), "x bar";
···6464 Genarray.set gen pos (-1.);
6565 let different = Genarray.get gen pos <> initial in
6666 let gen' = Genarray.change_layout gen fortran in
6767- Genarray.set gen' ( Array.init rank @@ fun n -> 1 + pos.( rank - 1 - n ) ) initial;
6767+ Genarray.set gen' ( Array.init rank @@ fun n -> 1 + pos.( rank - 1 - n ) )
6868+ initial;
6869 if not (different && initial = Genarray.get gen pos) then Some pos
6970 else None
7071
+2-2
testsuite/tests/lib-bytes/test_bytes.ml
···4455let test_raises_invalid_argument f x =
66 ignore
77- (Testing.test_raises_exc_p (function Invalid_argument _ -> true | _ -> false)
88- f x)
77+ (Testing.test_raises_exc_p
88+ (function Invalid_argument _ -> true | _ -> false) f x)
991010let check b offset s =
1111 let rec loop i =
+8-4
testsuite/tests/lib-digest/md5.ml
···134134 data
135135136136let int32_to_string n s i =
137137- Bytes.set s (i+3) (Char.chr (Int32.to_int (Int32.shift_right n 24) land 0xFF));
138138- Bytes.set s (i+2) (Char.chr (Int32.to_int (Int32.shift_right n 16) land 0xFF));
139139- Bytes.set s (i+1) (Char.chr (Int32.to_int (Int32.shift_right n 8) land 0xFF));
140140- Bytes.set s i (Char.chr (Int32.to_int n land 0xFF))
137137+ Bytes.set s (i+3)
138138+ (Char.chr (Int32.to_int (Int32.shift_right n 24) land 0xFF));
139139+ Bytes.set s (i+2)
140140+ (Char.chr (Int32.to_int (Int32.shift_right n 16) land 0xFF));
141141+ Bytes.set s (i+1)
142142+ (Char.chr (Int32.to_int (Int32.shift_right n 8) land 0xFF));
143143+ Bytes.set s i
144144+ (Char.chr (Int32.to_int n land 0xFF))
141145142146let init () =
143147 { buf = Bytes.create 64;
+1-1
testsuite/tests/lib-dynlink-native/main.ml
···88include systhreads
99include dynlink
10101111-set subdir = "${test_source_directory}/sub"
1111+set subdir = "${test_source_directory}/sub"
12121313* native-dynlink
1414libraries = "" (* We will add them manually where appropriated *)
+2-1
testsuite/tests/lib-hashtbl/htbl.ml
···4545 let check_to_seq_of_seq h =
4646 let h' = H.create (H.length h) in
4747 H.add_seq h' (H.to_seq h);
4848- (*printf "h.len=%d, h'.len=%d\n" (List.length @@ to_list_ h) (List.length @@ to_list_ h');*)
4848+ (*printf "h.len=%d, h'.len=%d\n" (List.length @@ to_list_ h)
4949+ (List.length @@ to_list_ h');*)
4950 assert (to_list_ h = to_list_ h')
50515152 let test data =
+2-1
testsuite/tests/lib-list/test.ml
···5959 let _ = List.init n (fun x -> result := (x = n - 1)) in
6060 assert !result
6161 in
6262- let threshold = 10_000 in (* Threshold must equal the value in stdlib/list.ml *)
6262+ (* Threshold must equal the value in stdlib/list.ml *)
6363+ let threshold = 10_000 in
6364 test threshold; (* Non tail-recursive case *)
6465 test (threshold + 1) (* Tail-recursive case *)
6566;;
+1-3
testsuite/tests/lib-seq/test.ml
···1111 |> Seq.filter (fun x -> x mod 2 = 0)
1212 |> List.of_seq));
1313 ()
1414-;;
1414+;;
15151616let () = print_endline "OK";;
1717-1818-
+2-1
testsuite/tests/lib-threads/torture.ml
···3232(* print_string "reader "; print_int n; print_newline(); *)
3333 for i = 0 to n-1 do
3434 if Bytes.get buff i = 'b' then Thread.exit()
3535- else if Bytes.get buff i <> 'a' then print_string "error in reader_thread\n"
3535+ else if Bytes.get buff i <> 'a' then
3636+ print_string "error in reader_thread\n"
3637 done
3738 done
3839
+2-2
testsuite/tests/lib-unix/common/cloexec.ml
···77 Presumably this is because the OCaml runtime opens files, so that handles
88 that have actually been closed at execution look open and make the
99 test fail.
1010-1010+1111 One possible fix for this would be to make it possible for ocamltest to
1212 compile C-only programs, which will be a bit of work to handle the
1313 output of msvc and will also duplicate what the ocaml compiler itslef
···9797 p0;p0';p1;p1';p2;p2';
9898 s0;s1;s2;
9999 x0;x0';x1;x1';x2;x2' |] in
100100- let untested =
100100+ let untested =
101101 [untested1; untested2; untested3; untested4; untested5]
102102 in
103103 let pid =
+1-3
testsuite/tests/lib-unix/common/dup2.ml
···1818 let fd =
1919 Unix.(openfile "./tmp.txt"
2020 [O_WRONLY;O_TRUNC;O_CREAT;O_SHARE_DELETE]
2121- 0o600) in
2121+ 0o600) in
2222 out fd "---\n";
2323 Unix.dup2 ~cloexec:true fd Unix.stderr;
2424 Unix.close fd;
2525 out Unix.stderr "Some output\n";
2626 cat "./tmp.txt";
2727 Sys.remove "./tmp.txt"
2828-2929-
+4-3
testsuite/tests/lib-unix/common/redirections.ml
···5555 let pid =
5656 Unix.create_process_env
5757 refl
5858- [| refl; "-i2o"; "-i2e"; "-o"; "123"; "-e"; "456"; "-i2o"; "-v"; "XVAR" |]
5858+ [| refl; "-i2o"; "-i2e"; "-o"; "123"; "-e"; "456"; "-i2o"; "-v"; "XVAR"
5959+ |]
5960 (Array.append [| "XVAR=xvar" |] systemenv)
6061 p_exit f_out f_err in
6162 out p_entrance "aaaa\n";
···115116 (refl ^ " -o 123 -i2o -e 456 -i2e -v XVAR")
116117 (Array.append [|"XVAR=xvar"|] systemenv) in
117118 output_string i "aa\nbbbb\n"; close_out i;
118118- for _i = 1 to 3 do
119119+ for _i = 1 to 3 do
119120 out Unix.stdout (input_line o ^ "\n")
120121 done;
121122 for _i = 1 to 2 do
···128129let _ =
129130 let env = Unix.environment() in
130131 (* The following 'close' makes things more difficult.
131131- Under Unix it works fine, but under Win32 create_process
132132+ Under Unix it works fine, but under Win32 create_process
132133 gives an error if one of the standard handles is closed. *)
133134 (* Unix.close Unix.stdin; *)
134135 out Unix.stdout "** create_process\n";
+4-5
testsuite/tests/lib-unix/common/reflector.ml
···11-let copyline input output =
11+let copyline input output =
22 let rec copy() = match input_char input with
33 | exception End_of_file ->
44 output_string output "<end of file>\n"
55 | char ->
66 output_char output char;
77- if char='\n' then () else copy()
77+ if char='\n' then () else copy()
88 in
99 copy();
1010 flush output
···16161717let output_env_var output env_var =
1818 let value = match Sys.getenv_opt env_var with
1919- | None -> "<no such variable>"
1919+ | None -> "<no such variable>"
2020 | Some v -> v
2121 in
2222 output_endline stdout value
···4444 output_endline stderr "<bad argument>"
45454646let () =
4747- set_binary_mode_in stdin true;
4747+ set_binary_mode_in stdin true;
4848 set_binary_mode_out stdout true;
4949 set_binary_mode_out stderr true;
5050 Arg.parse options report_bad_argument ""
5151-
···11-File "aliases.ml", line 16, characters 12-13:
22-Warning 49: no cmi file was found in path for module A
31File "aliases.ml", line 17, characters 12-13:
22+Warning 49: no cmi file was found in path for module A
33+File "aliases.ml", line 18, characters 12-13:
44Warning 49: no valid cmi file was found in path for module B. b.cmi
55is not a compiled interface
···11(* TEST
22- arguments = "???"
22+ arguments = "???"
33 *)
4455(* On Windows the runtime expand windows wildcards (asterisks and
66 * question marks).
77 *
88- * This file is a non-regression test for github's PR#1623.
88+ * This file is a non-regression test for github's PR#1623.
99 *
1010- * On Windows 64bits, a segfault was triggered when one argument consists
1111- * only of wildcards.
1010+ * On Windows 64bits, a segfault was triggered when one argument consists
1111+ * only of wildcards.
1212 *
1313 * The source code of this test is empty: we just check the arguments
1414 * expansion.
···55(** Test the html rendering of ocamldoc documentation tags *)
6677val heterological: unit
88-(**
88+(**
99 @author yes
1010 @param no No description
1111- @param neither see no description
1111+ @param neither see no description
1212 @deprecated since the start of time
1313 @return ()
1414 @see "Documentation_tags.mli" Self reference
···77\usepackage{ocamldoc}
88\begin{document}
99\tableofcontents
1010-\section{Module {\tt{Level\_0}} : Test for level 0 headings }
1010+\section{Module {\tt{Level\_0}} : Test for level 0 headings}
1111\label{Level-underscore0}\index{Level-underscore0@\verb`Level_0`}
1212131314141515 \subsection*{Level 1}
1616-1616+171718181919 Standard heading levels start at 1.
···2525 the main heading of the module.
262627272828- This setup allows users to start their standard heading at level 1 rather
2929- than 2, without losing the ability to add global level heading,
2828+ This setup allows users to start their standard heading at level 1 rather
2929+ than 2, without losing the ability to add global level heading,
3030 when, if ever, such heading is warranted
31313232
+6-6
testsuite/tests/tool-ocamldoc/Level_0.mli
···22 * ocamldoc with latex
33*)
4455-(** Test for level 0 headings
66-77- {1 Level 1}
88-55+(** Test for level 0 headings
66+77+ {1 Level 1}
88+99 Standard heading levels start at 1.
10101111 {0 Level 0}
1212 A level 0 heading is guaranted to be at the same level that
1313 the main heading of the module.
14141515- This setup allows users to start their standard heading at level 1 rather
1616- than 2, without losing the ability to add global level heading,
1515+ This setup allows users to start their standard heading at level 1 rather
1616+ than 2, without losing the ability to add global level heading,
1717 when, if ever, such heading is warranted
18181919 *)
···132132133133<p>See <a href="http://caml.inria.fr/mantis/view.php?id=7272">MPR#7272</a> for more
134134information.</p>
135135-</body></html>135135+</body></html>
···2222<p>This is a documentation comment for <code class="code">x</code>, not a module preamble.</p>
2323</div>
2424</div>
2525-</body></html>2525+</body></html>
···11(setglobal Module_coercion!
22- (let (M = (module-defn(M) module_coercion.ml(13):417-1116 (makeblock 0)))
22+ (let (M = (module-defn(M) module_coercion.ml(15):436-1135 (makeblock 0)))
33 (makeblock 0 M
44- (module-defn(M_int) module_coercion.ml(44):1533-1572
44+ (module-defn(M_int) module_coercion.ml(46):1552-1591
55 (makeblock 0 (function prim stub (array.length[int] prim))
66 (function prim prim stub (array.get[int] prim prim))
77 (function prim prim stub (array.unsafe_get[int] prim prim))
···1515 (function prim prim stub (> prim prim))
1616 (function prim prim stub (<= prim prim))
1717 (function prim prim stub (>= prim prim))))
1818- (module-defn(M_float) module_coercion.ml(45):1575-1618
1818+ (module-defn(M_float) module_coercion.ml(47):1594-1637
1919 (makeblock 0 (function prim stub (array.length[float] prim))
2020 (function prim prim stub (array.get[float] prim prim))
2121 (function prim prim stub (array.unsafe_get[float] prim prim))
···2929 (function prim prim stub (>. prim prim))
3030 (function prim prim stub (<=. prim prim))
3131 (function prim prim stub (>=. prim prim))))
3232- (module-defn(M_string) module_coercion.ml(46):1621-1666
3232+ (module-defn(M_string) module_coercion.ml(48):1640-1685
3333 (makeblock 0 (function prim stub (array.length[addr] prim))
3434 (function prim prim stub (array.get[addr] prim prim))
3535 (function prim prim stub (array.unsafe_get[addr] prim prim))
···4343 (function prim prim stub (caml_string_greaterthan prim prim))
4444 (function prim prim stub (caml_string_lessequal prim prim))
4545 (function prim prim stub (caml_string_greaterequal prim prim))))
4646- (module-defn(M_int32) module_coercion.ml(47):1669-1712
4646+ (module-defn(M_int32) module_coercion.ml(49):1688-1731
4747 (makeblock 0 (function prim stub (array.length[addr] prim))
4848 (function prim prim stub (array.get[addr] prim prim))
4949 (function prim prim stub (array.unsafe_get[addr] prim prim))
···5757 (function prim prim stub (Int32.> prim prim))
5858 (function prim prim stub (Int32.<= prim prim))
5959 (function prim prim stub (Int32.>= prim prim))))
6060- (module-defn(M_int64) module_coercion.ml(48):1715-1758
6060+ (module-defn(M_int64) module_coercion.ml(50):1734-1777
6161 (makeblock 0 (function prim stub (array.length[addr] prim))
6262 (function prim prim stub (array.get[addr] prim prim))
6363 (function prim prim stub (array.unsafe_get[addr] prim prim))
···7171 (function prim prim stub (Int64.> prim prim))
7272 (function prim prim stub (Int64.<= prim prim))
7373 (function prim prim stub (Int64.>= prim prim))))
7474- (module-defn(M_nativeint) module_coercion.ml(49):1761-1812
7474+ (module-defn(M_nativeint) module_coercion.ml(51):1780-1831
7575 (makeblock 0 (function prim stub (array.length[addr] prim))
7676 (function prim prim stub (array.get[addr] prim prim))
7777 (function prim prim stub (array.unsafe_get[addr] prim prim))
···11(setglobal Module_coercion!
22- (let (M = (module-defn(M) module_coercion.ml(13):417-1116 (makeblock 0)))
22+ (let (M = (module-defn(M) module_coercion.ml(15):436-1135 (makeblock 0)))
33 (makeblock 0 M
44- (module-defn(M_int) module_coercion.ml(44):1533-1572
44+ (module-defn(M_int) module_coercion.ml(46):1552-1591
55 (makeblock 0 (function prim stub (array.length[int] prim))
66 (function prim prim stub (array.get[int] prim prim))
77 (function prim prim stub (array.unsafe_get[int] prim prim))
···1515 (function prim prim stub (> prim prim))
1616 (function prim prim stub (<= prim prim))
1717 (function prim prim stub (>= prim prim))))
1818- (module-defn(M_float) module_coercion.ml(45):1575-1618
1818+ (module-defn(M_float) module_coercion.ml(47):1594-1637
1919 (makeblock 0 (function prim stub (array.length[addr] prim))
2020 (function prim prim stub (array.get[addr] prim prim))
2121 (function prim prim stub (array.unsafe_get[addr] prim prim))
···2929 (function prim prim stub (>. prim prim))
3030 (function prim prim stub (<=. prim prim))
3131 (function prim prim stub (>=. prim prim))))
3232- (module-defn(M_string) module_coercion.ml(46):1621-1666
3232+ (module-defn(M_string) module_coercion.ml(48):1640-1685
3333 (makeblock 0 (function prim stub (array.length[addr] prim))
3434 (function prim prim stub (array.get[addr] prim prim))
3535 (function prim prim stub (array.unsafe_get[addr] prim prim))
···4343 (function prim prim stub (caml_string_greaterthan prim prim))
4444 (function prim prim stub (caml_string_lessequal prim prim))
4545 (function prim prim stub (caml_string_greaterequal prim prim))))
4646- (module-defn(M_int32) module_coercion.ml(47):1669-1712
4646+ (module-defn(M_int32) module_coercion.ml(49):1688-1731
4747 (makeblock 0 (function prim stub (array.length[addr] prim))
4848 (function prim prim stub (array.get[addr] prim prim))
4949 (function prim prim stub (array.unsafe_get[addr] prim prim))
···5757 (function prim prim stub (Int32.> prim prim))
5858 (function prim prim stub (Int32.<= prim prim))
5959 (function prim prim stub (Int32.>= prim prim))))
6060- (module-defn(M_int64) module_coercion.ml(48):1715-1758
6060+ (module-defn(M_int64) module_coercion.ml(50):1734-1777
6161 (makeblock 0 (function prim stub (array.length[addr] prim))
6262 (function prim prim stub (array.get[addr] prim prim))
6363 (function prim prim stub (array.unsafe_get[addr] prim prim))
···7171 (function prim prim stub (Int64.> prim prim))
7272 (function prim prim stub (Int64.<= prim prim))
7373 (function prim prim stub (Int64.>= prim prim))))
7474- (module-defn(M_nativeint) module_coercion.ml(49):1761-1812
7474+ (module-defn(M_nativeint) module_coercion.ml(51):1780-1831
7575 (makeblock 0 (function prim stub (array.length[addr] prim))
7676 (function prim prim stub (array.get[addr] prim prim))
7777 (function prim prim stub (array.unsafe_get[addr] prim prim))
···225225module rec M : sig val x : X.t end
226226|}]
227227228228-module rec M : sig val x: X.t end = struct let x = X.x end [@@ocaml.warning "-3"]
228228+module rec M : sig val x: X.t end =
229229+ struct
230230+ let x = X.x
231231+ end [@@ocaml.warning "-3"]
229232[%%expect{|
230233module rec M : sig val x : X.t end
231234|}]
···575578module X : sig end
576579|}]
577580578578-let x = ((() [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"]) [@ocaml.ppwarning "Pp warning 2!"]
581581+let x =
582582+ ((() [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"])
583583+ [@ocaml.ppwarning "Pp warning 2!"]
579584;;
580585[%%expect{|
581581-Line _, characters 93-108:
582582- let x = ((() [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"]) [@ocaml.ppwarning "Pp warning 2!"]
583583- ^^^^^^^^^^^^^^^
586586+Line _, characters 23-38:
587587+ [@ocaml.ppwarning "Pp warning 2!"]
588588+ ^^^^^^^^^^^^^^^
584589Warning 22: Pp warning 2!
585590val x : unit = ()
586591|}]
587592588588-type t = ((unit [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"]) [@ocaml.ppwarning "Pp warning 2!"]
593593+type t =
594594+ ((unit [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"])
595595+ [@ocaml.ppwarning "Pp warning 2!"]
589596 [@@ocaml.ppwarning "Pp warning 3!"]
590597;;
591598[%%expect{|
···593600 [@@ocaml.ppwarning "Pp warning 3!"]
594601 ^^^^^^^^^^^^^^^
595602Warning 22: Pp warning 3!
596596-Line _, characters 96-111:
597597- type t = ((unit [@ocaml.ppwarning "Pp warning 1!"]) [@ocaml.warning "-22"]) [@ocaml.ppwarning "Pp warning 2!"]
598598- ^^^^^^^^^^^^^^^
603603+Line _, characters 21-36:
604604+ [@ocaml.ppwarning "Pp warning 2!"]
605605+ ^^^^^^^^^^^^^^^
599606Warning 22: Pp warning 2!
600607type t = unit
601608|}]
-1
testsuite/tests/typing-gadts/pr6934.ml
···99 ^^^^^
1010Error: GADT case syntax cannot be used in a 'nonrec' block.
1111|}]
1212-
+1-1
testsuite/tests/typing-misc/empty_variant.ml
···2525val g : m -> 'a = <fun>
2626|}]
27272828-let f : t option -> int = function None -> 3
2828+let f : t option -> int = function None -> 3
2929[%%expect{|
3030val f : t option -> int = <fun>
3131|}]
-1
testsuite/tests/typing-modules-bugs/pr6485_ok.ml
···5151 let module Baz = String_id2.Make(struct let module_name="Baz" end) in
5252 let baz = Baz.of_string "baz" in
5353 Printf.printf "baz = %s\n" (baz :> string)
5454-
+3-2
testsuite/tests/typing-modules-bugs/pr7601_ok.ml
···1919 [< `Location of t
2020 | `Value of t
2121 | `None ] as 'a
2222- val of_var : ?f:string -> string -> [ `Location of _ | `Value of _ | `None ] maybe_region
2222+ val of_var :
2323+ ?f:string -> string ->
2424+ [ `Location of _ | `Value of _ | `None ] maybe_region
2325end
24262527module Make (Analysis : Analysis) = struct
2628 include Analysis
2729 let of_var = of_var ~f:""
2830end
2929-
···22Error (warning 8): this pattern-matching is not exhaustive.
33Here is an example of a case that is not matched:
44Y
55-File "b_bad.ml", line 17, characters 11-14:
55+File "b_bad.ml", line 18, characters 11-14:
66Error: Unbound value A.y
+2-1
testsuite/tests/typing-safe-linking/b_bad.ml
···1313let f : string A.t -> unit = function
1414 A.X s -> print_endline s
15151616-(* It is important that the line below is the last line of the file (see Makefile) *)
1616+(* It is important that the line below is the last line of the file
1717+ (see Makefile) *)
1718let () = f A.y
···7777module Pr7438 : sig
7878end = struct
7979 module type S = sig type t = private [> `Foo] end
8080- module type X = sig type t = private [> `Foo | `Bar] include S with type t := t end
8080+ module type X =
8181+ sig type t = private [> `Foo | `Bar] include S with type t := t end
8182end;;
···6565 for f in flexdll.h flexlink.exe flexdll*_msvc.obj default*.manifest ; do
6666 cp $f "$OCAMLROOT/bin/flexdll/"
6767 done
6868- echo 'eval $($APPVEYOR_BUILD_FOLDER/tools/msvs-promote-path)' >> ~/.bash_profile
6868+ echo 'eval $($APPVEYOR_BUILD_FOLDER/tools/msvs-promote-path)' \
6969+ >> ~/.bash_profile
6970 ;;
7071 msvc32-only)
7172 cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-msvc32
···107108 cd $APPVEYOR_BUILD_FOLDER/../$BUILD_PREFIX-msvc64
108109109110 export TERM=ansi
110110- script --quiet --return --command "make -C ../$BUILD_PREFIX-mingw32 flexdll world.opt" ../$BUILD_PREFIX-mingw32/build.log >/dev/null 2>/dev/null &
111111+ script --quiet --return --command \
112112+ "make -C ../$BUILD_PREFIX-mingw32 flexdll world.opt" \
113113+ ../$BUILD_PREFIX-mingw32/build.log >/dev/null 2>/dev/null &
111114 BUILD_PID=$!
112115113116 run "make world" make world
···117120118121 set +e
119122120120- # For an explanation of the sed command, see https://github.com/appveyor/ci/issues/1824
121121- tail --pid=$BUILD_PID -n +1 -f ../$BUILD_PREFIX-mingw32/build.log | sed -e 's/\d027\[K//g' -e 's/\d027\[m/\d027[0m/g' -e 's/\d027\[01\([m;]\)/\d027[1\1/g' &
123123+ # For an explanation of the sed command, see
124124+ # https://github.com/appveyor/ci/issues/1824
125125+ tail --pid=$BUILD_PID -n +1 -f ../$BUILD_PREFIX-mingw32/build.log | \
126126+ sed -e 's/\d027\[K//g' \
127127+ -e 's/\d027\[m/\d027[0m/g' \
128128+ -e 's/\d027\[01\([m;]\)/\d027[1\1/g' &
122129 TAIL_PID=$!
123130 wait $BUILD_PID
124131 STATUS=$?
+7-8
tools/ci/inria/extra-checks
···16161717# This script is run on our continuous-integration servers to recompile
1818# from scratch, adding more run-time checks ("sanitizers") to the C code,
1919-# and run the test suite.
1919+# and run the test suite.
20202121# In this context, it is necessary to skip a few tests whose behaviour
2222# is modified by the instrumentation:
···126126$make -s distclean || :
127127128128# Use clang 6.0
129129-# We cannot give the sanitizer options as part of -cc because
130130-# then various autoconfiguration tests fail.
129129+# We cannot give the sanitizer options as part of -cc because
130130+# then various autoconfiguration tests fail.
131131# Instead, we'll fix CFLAGS a posteriori.
132132./configure -cc clang-6.0
133133134134# These are the undefined behaviors we want to check
135135-# Others occur on purpose e.g. signed arithmetic overflow
135135+# Others occur on purpose e.g. signed arithmetic overflow
136136ubsan="\
137137bool,\
138138builtin,\
···195195196196#########################################################################
197197198198-# This is a failed attempt at using the memory sanitizer
198198+# This is a failed attempt at using the memory sanitizer
199199# (to detect reads from uninitialized memory).
200200# Some alarms are reported that look like false positive
201201# and are impossible to debug.
···205205# $make -s distclean || :
206206207207# # Use clang 6.0
208208-# # We cannot give the sanitizer options as part of -cc because
209209-# # then various autoconfiguration tests fail.
208208+# # We cannot give the sanitizer options as part of -cc because
209209+# # then various autoconfiguration tests fail.
210210# # Instead, we'll fix CFLAGS a posteriori.
211211# # Memory sanitizer doesn't like the static data generated by ocamlopt,
212212# # hence build bytecode only
···226226# # Build the system (bytecode only) and test
227227# make $jobs world
228228# $run_testsuite
229229-
+2-1
tools/lintapidiff.ml
···248248 let first_seen = Version.of_string_exn rev in
249249 let empty = {last_not_seen=None;first_seen;deprecated=false} in
250250 let f = Ast.parse_file ~orig:path ~init:empty ~f:(fun _ _ attrs ->
251251- { last_not_seen=None;first_seen; deprecated=Doc.is_deprecated attrs }) in
251251+ { last_not_seen=None;first_seen; deprecated=Doc.is_deprecated attrs })
252252+ in
252253 let map = match Git.with_show ~f rev path with
253254 | Ok r -> r
254255 | Error `Not_found -> IdMap.empty
+4-2
tools/objinfo.ml
···327327 end
328328329329let arg_list = [
330330- "-no-approx", Arg.Set no_approx, " Do not print module approximation information";
331331- "-no-code", Arg.Set no_code, " Do not print code from exported flambda functions";
330330+ "-no-approx", Arg.Set no_approx,
331331+ " Do not print module approximation information";
332332+ "-no-code", Arg.Set no_code,
333333+ " Do not print code from exported flambda functions";
332334 "-null-crc", Arg.Set no_crc, " Print a null CRC for imported interfaces";
333335 "-args", Arg.Expand Arg.read_arg,
334336 "<file> Read additional newline separated command line arguments \n\
+4-4
tools/ocamlprof.ml
···507507 "-vnum", Arg.Unit print_version_num,
508508 " Print version number and exit";
509509 "-args", Arg.Expand Arg.read_arg,
510510- "<file> Read additional newline separated command line arguments \n\
511511- \ from <file>";
510510+ "<file> Read additional newline separated command line arguments \n\
511511+ \ from <file>";
512512 "-args0", Arg.Expand Arg.read_arg0,
513513- "<file> Read additional NUL separated command line arguments from \n\
514514- \ <file>"
513513+ "<file> Read additional NUL separated command line arguments from \n\
514514+ \ <file>"
515515 ] process_anon_file usage;
516516 exit 0
517517 with
···32323333let expand_position pos len =
3434 if pos < !first_nonexpanded_pos then
3535- first_nonexpanded_pos := !first_nonexpanded_pos + len (* Shift the position *)
3535+ (* Shift the position *)
3636+ first_nonexpanded_pos := !first_nonexpanded_pos + len
3637 else
3737- first_nonexpanded_pos := pos + len + 2 (* New last position *)
3838+ (* New last position *)
3939+ first_nonexpanded_pos := pos + len + 2
384039414042let prepare ppf =
···6365 than the original argv.
6466 *)
6567 Printf.eprintf "For implementation reasons, the toplevel does not support\
6666- \ having script files (here %S) inside expanded arguments passed through the\
6767- \ -args{,0} command-line option.\n" name;
6868+ \ having script files (here %S) inside expanded arguments passed through\
6969+ \ the -args{,0} command-line option.\n" name;
6870 exit 2
6971 end else begin
7072 let newargs = Array.sub !argv !Arg.current
+4-2
toplevel/topmain.ml
···33333434let expand_position pos len =
3535 if pos < !first_nonexpanded_pos then
3636- first_nonexpanded_pos := !first_nonexpanded_pos + len (* Shift the position *)
3636+ (* Shift the position *)
3737+ first_nonexpanded_pos := !first_nonexpanded_pos + len
3738 else
3838- first_nonexpanded_pos := pos + len + 2 (* New last position *)
3939+ (* New last position *)
4040+ first_nonexpanded_pos := pos + len + 2
39414042let prepare ppf =
4143 Toploop.set_paths ();
+1-1
typing/btype.ml
···210210211211(**** Utilities for fixed row private types ****)
212212213213-let row_of_type t =
213213+let row_of_type t =
214214 match (repr t).desc with
215215 Tobject(t,_) ->
216216 let rec get_row t =
+2-1
typing/ctype.mli
···170170171171val unify: Env.t -> type_expr -> type_expr -> unit
172172 (* Unify the two types given. Raise [Unify] if not possible. *)
173173-val unify_gadt: equations_level:int -> Env.t ref -> type_expr -> type_expr -> unit
173173+val unify_gadt:
174174+ equations_level:int -> Env.t ref -> type_expr -> type_expr -> unit
174175 (* Unify the two types given and update the environment with the
175176 local constraints. Raise [Unify] if not possible. *)
176177val unify_var: Env.t -> type_expr -> type_expr -> unit
+16-8
typing/env.ml
···7878 val create : 'a -> ('a,'b) t
7979 val get_arg : ('a,'b) t -> 'a option
80808181- (* [force_logged log f t] is equivalent to [force f t] but if [f] returns [None] then
8282- [t] is recorded in [log]. [backtrack log] will then reset all the recorded [t]s back
8383- to their original state. *)
8181+ (* [force_logged log f t] is equivalent to [force f t] but if [f] returns
8282+ [None] then [t] is recorded in [log]. [backtrack log] will then reset all
8383+ the recorded [t]s back to their original state. *)
8484 val log : unit -> log
8585 val force_logged : log -> ('a -> 'b option) -> ('a,'b option) t -> 'b option
8686 val backtrack : log -> unit
···386386387387388388 let rec find_all name tbl =
389389- List.map (fun (id, desc) -> Pident id, desc) (Ident.find_all name tbl.current) @
389389+ List.map (fun (id, desc) -> Pident id, desc)
390390+ (Ident.find_all name tbl.current) @
390391 match tbl.opened with
391392 | None -> []
392393 | Some {root; using = _; next; components} ->
···397398 find_all name next
398399399400 let rec fold_name f tbl acc =
400400- let acc = Ident.fold_name (fun id d -> f (Ident.name id) (Pident id, d)) tbl.current acc in
401401+ let acc =
402402+ Ident.fold_name (fun id d -> f (Ident.name id) (Pident id, d))
403403+ tbl.current acc
404404+ in
401405 match tbl.opened with
402406 | Some {root; using = _; next; components} ->
403407 acc
···420424 match tbl.opened with
421425 | Some {root; using = _; next; components} ->
422426 Tbl.iter
423423- (fun s (x, pos) -> f (Ident.hide (Ident.create s) (* ??? *)) (Pdot (root, s, pos), x))
427427+ (fun s (x, pos) ->
428428+ f (Ident.hide (Ident.create s) (* ??? *))
429429+ (Pdot (root, s, pos), x))
424430 components;
425431 iter f next
426432 | None -> ()
···12851291}
1286129212871293let make_copy_of_types l env : copy_of_types =
12881288- let f desc = { desc with val_type = Subst.type_expr Subst.identity desc.val_type} in
12891289- let values = List.fold_left (fun env s -> IdTbl.update s f env) env.values l in
12941294+ let f desc =
12951295+ {desc with val_type = Subst.type_expr Subst.identity desc.val_type} in
12961296+ let values =
12971297+ List.fold_left (fun env s -> IdTbl.update s f env) env.values l in
12901298 {to_copy = l; initial_values = env.values; new_values = values}
1291129912921300let do_copy_types { to_copy = l; initial_values; new_values = values } env =
···232232 | ld1::rem1, ld2::rem2 ->
233233 if Ident.name ld1.ld_id <> Ident.name ld2.ld_id
234234 then [Field_names (n, ld1.ld_id, ld2.ld_id)]
235235- else if ld1.ld_mutable <> ld2.ld_mutable then [Field_mutable ld1.ld_id] else begin
235235+ else if ld1.ld_mutable <> ld2.ld_mutable then
236236+ [Field_mutable ld1.ld_id]
237237+ else begin
236238 Builtin_attributes.check_deprecated_mutable_inclusion
237239 ~def:ld1.ld_loc
238240 ~use:ld2.ld_loc
+2-1
typing/includemod.mli
···3636 module_type -> module_type -> module_coercion
37373838val check_modtype_inclusion :
3939- loc:Location.t -> Env.t -> Types.module_type -> Path.t -> Types.module_type -> unit
3939+ loc:Location.t -> Env.t -> Types.module_type -> Path.t -> Types.module_type ->
4040+ unit
4041(** [check_modtype_inclusion ~loc env mty1 path1 mty2] checks that the
4142 functor application F(M) is well typed, where mty2 is the type of
4243 the argument of F and path1/mty1 is the path/unstrenghened type of M. *)
+5-2
typing/oprint.ml
···7979 if isneg then pp_print_char ppf ')'
80808181let escape_string s =
8282- (* Escape only C0 control characters (bytes <= 0x1F), DEL(0x7F), '\\' and '"' *)
8282+ (* Escape only C0 control characters (bytes <= 0x1F), DEL(0x7F), '\\'
8383+ and '"' *)
8384 let n = ref 0 in
8485 for i = 0 to String.length s - 1 do
8586 n := !n +
···151152 | Oval_int32 i -> parenthesize_if_neg ppf "%lil" i (i < 0l)
152153 | Oval_int64 i -> parenthesize_if_neg ppf "%LiL" i (i < 0L)
153154 | Oval_nativeint i -> parenthesize_if_neg ppf "%nin" i (i < 0n)
154154- | Oval_float f -> parenthesize_if_neg ppf "%s" (float_repres f) (f < 0.0 || 1. /. f = neg_infinity)
155155+ | Oval_float f ->
156156+ parenthesize_if_neg ppf "%s" (float_repres f)
157157+ (f < 0.0 || 1. /. f = neg_infinity)
155158 | Oval_string (_,_, Ostr_bytes) as tree ->
156159 pp_print_char ppf '(';
157160 print_simple_tree ppf tree;
+7-5
typing/parmatch.ml
···820820| ({pat_desc = Tpat_array(_)},_) :: _ -> false
821821| ({pat_desc = Tpat_lazy(_)},_) :: _ -> true
822822823823-(* Written as a non-fragile matching, PR#7451 originated from a fragile matching below. *)
823823+(* Written as a non-fragile matching, PR#7451 originated from a fragile matching
824824+ below. *)
824825let should_extend ext env = match ext with
825826| None -> false
826827| Some ext -> begin match env with
···13611362 exhaust
13621363 ext pss (List.length (simple_match_args p omega) + n - 1)
13631364 with
13641364- | Witnesses r -> Witnesses (List.map (fun row -> (set_args p row)) r)
13651365+ | Witnesses r ->
13661366+ Witnesses (List.map (fun row -> (set_args p row)) r)
13651367 | r -> r in
13661368 let before = try_many try_non_omega constrs in
13671369 if
···19731975 Buffer.add_string buf
19741976 "\nMatching over values of extensible variant types \
19751977 (the *extension* above)\n\
19761976- must include a wild card pattern in order to be exhaustive."
19781978+ must include a wild card pattern in order to be exhaustive."
19771979 ;
19781980 Buffer.contents buf
19791981 with _ ->
···20822084 - the clause under consideration is not a refutation clause
20832085 and either:
20842086 + there are no other lines
20852085- + we do not care whether the types prevent this clause to be
20862086- reached.
20872087+ + we do not care whether the types prevent this clause to
20882088+ be reached.
20872089 If the clause under consideration *is* a refutation clause
20882090 then we do need to check more carefully whether it can be
20892091 refuted or not. *)
+4-3
typing/parmatch.mli
···106106(* Irrefutability tests *)
107107val irrefutable : pattern -> bool
108108109109-(** An inactive pattern is a pattern, matching against which can be duplicated, erased or
110110- delayed without change in observable behavior of the program. Patterns containing
111111- (lazy _) subpatterns or reads of mutable fields are active. *)
109109+(** An inactive pattern is a pattern, matching against which can be duplicated,
110110+ erased or delayed without change in observable behavior of the program.
111111+ Patterns containing (lazy _) subpatterns or reads of mutable fields are
112112+ active. *)
112113val inactive : partial:partial -> pattern -> bool
113114114115(* Ambiguous bindings *)
+4-2
typing/printtyp.ml
···15261526 when is_unit env ty1 && unifiable env t3 ty2 ->
15271527 Some (fun ppf ->
15281528 fprintf ppf
15291529- "@,@[Hint: Did you forget to wrap the expression using `fun () ->'?@]")
15291529+ "@,@[Hint: Did you forget to wrap the expression using \
15301530+ `fun () ->'?@]")
15301531 | Ttuple [], Tvar _ | Tvar _, Ttuple [] ->
15311532 Some (fun ppf ->
15321533 fprintf ppf "@,Self type cannot escape its class")
···15841585 Some (fun ppf ->
15851586 let row1 = row_repr row1 and row2 = row_repr row2 in
15861587 begin match
15871587- row1.row_fields, row1.row_closed, row2.row_fields, row2.row_closed with
15881588+ row1.row_fields, row1.row_closed,
15891589+ row2.row_fields, row2.row_closed with
15881590 | [], true, [], true ->
15891591 fprintf ppf "@,These two variant types have no intersection"
15901592 | [], true, (_::_ as fields), _ ->
+2-3
typing/printtyp.mli
···9292val print_items: (Env.t -> signature_item -> 'a option) ->
9393 Env.t -> signature_item list -> (out_sig_item * 'a option) list
94949595-(* Simple heuristic to rewrite Foo__bar.* as Foo.Bar.* when Foo.Bar is an alias for
9696- Foo__bar. This pattern is used by the stdlib. *)
9595+(* Simple heuristic to rewrite Foo__bar.* as Foo.Bar.* when Foo.Bar is an alias
9696+ for Foo__bar. This pattern is used by the stdlib. *)
9797val rewrite_double_underscore_paths: Env.t -> Path.t -> Path.t
9898-
+6-3
typing/rec_check.ml
···6666 (** The address of a subexpression is not used, but may be bound *)
67676868 val inspect : t -> t
6969- (** The value of a subexpression is inspected with match, application, etc. *)
6969+ (** The value of a subexpression is inspected with match, application,
7070+ etc. *)
70717172 val delay : t -> t
7273 (** An expression appears under 'fun p ->' or 'lazy' *)
···636637 Use.(join ty
637638 (join (expression env c_rhs)
638639 (inspect (option expression env c_guard))))
639639-and value_bindings : rec_flag -> Env.env -> Typedtree.value_binding list -> Env.env * Use.t =
640640+and value_bindings :
641641+ rec_flag -> Env.env -> Typedtree.value_binding list -> Env.env * Use.t =
640642 fun rec_flag env bindings ->
641643 match rec_flag with
642644 | Recursive ->
···692694 | Tpat_variant _ -> true
693695 | Tpat_record (_, _) -> true
694696 | Tpat_array _ -> true
695695- | Tpat_or (l,r,_) -> is_destructuring_pattern l || is_destructuring_pattern r
697697+ | Tpat_or (l,r,_) ->
698698+ is_destructuring_pattern l || is_destructuring_pattern r
696699 | Tpat_lazy _ -> true
697700698701let is_valid_recursive_expression idlist expr =
+4-2
typing/typeclass.ml
···12281228 }
12291229 | Pcl_open (ovf, lid, e) ->
12301230 let used_slot = ref false in
12311231- let (path, new_val_env) = !Typecore.type_open ~used_slot ovf val_env scl.pcl_loc lid in
12321232- let (_path, new_met_env) = !Typecore.type_open ~used_slot ovf met_env scl.pcl_loc lid in
12311231+ let (path, new_val_env) =
12321232+ !Typecore.type_open ~used_slot ovf val_env scl.pcl_loc lid in
12331233+ let (_path, new_met_env) =
12341234+ !Typecore.type_open ~used_slot ovf met_env scl.pcl_loc lid in
12331235 let cl = class_expr cl_num new_val_env new_met_env e in
12341236 rc {cl_desc = Tcl_open (ovf, path, lid, new_val_env, cl);
12351237 cl_loc = scl.pcl_loc;
+37-22
typing/typecore.ml
···5555 | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list
5656 | Multiply_bound_variable of string
5757 | Orpat_vars of Ident.t * Ident.t list
5858- | Expr_type_clash of (type_expr * type_expr) list * type_forcing_context option
5858+ | Expr_type_clash of
5959+ (type_expr * type_expr) list * type_forcing_context option
5960 | Apply_non_function of type_expr
6061 | Apply_wrong_label of arg_label * type_expr
6162 | Label_multiply_defined of string
6263 | Label_missing of Ident.t list
6364 | Label_not_mutable of Longident.t
6464- | Wrong_name of string * type_expected * string * Path.t * string * string list
6565+ | Wrong_name of
6666+ string * type_expected * string * Path.t * string * string list
6567 | Name_type_mismatch of
6668 string * Longident.t * (Path.t * Path.t) * (Path.t * Path.t) list
6769 | Invalid_format of string
···486488 } env
487489 ) pv env
488490489489-let enter_variable ?(is_module=false) ?(is_as_variable=false) loc name ty attrs =
491491+let enter_variable ?(is_module=false) ?(is_as_variable=false) loc name ty
492492+ attrs =
490493 if List.exists (fun {pv_id; _} -> Ident.name pv_id = name.txt)
491494 !pattern_variables
492495 then raise(Error(loc, Env.empty, Multiply_bound_variable name.txt));
···537540 (x2,x1)::unify_vars rem1 rem2
538541 end
539542 | [],[] -> []
540540- | {pv_id; _}::_, [] | [],{pv_id; _}::_ -> raise (Error (loc, env, Orpat_vars (pv_id, [])))
543543+ | {pv_id; _}::_, [] | [],{pv_id; _}::_ ->
544544+ raise (Error (loc, env, Orpat_vars (pv_id, [])))
541545 | {pv_id = x; _}::_, {pv_id = y; _}::_ ->
542546 let err =
543547 if Ident.name x < Ident.name y
···10971101 pat_env = !env }
10981102 | Ppat_unpack name ->
10991103 assert (constrs = None);
11001100- let id = enter_variable loc name expected_ty ~is_module:true sp.ppat_attributes in
11041104+ let id =
11051105+ enter_variable loc name expected_ty ~is_module:true sp.ppat_attributes
11061106+ in
11011107 rp k {
11021108 pat_desc = Tpat_var (id, name);
11031109 pat_loc = sp.ppat_loc;
···11051111 pat_type = expected_ty;
11061112 pat_attributes = [];
11071113 pat_env = !env }
11081108- | Ppat_constraint({ppat_desc=Ppat_var name; ppat_loc=lloc; ppat_attributes = attrs},
11091109- ({ptyp_desc=Ptyp_poly _} as sty)) ->
11141114+ | Ppat_constraint(
11151115+ {ppat_desc=Ppat_var name; ppat_loc=lloc; ppat_attributes = attrs},
11161116+ ({ptyp_desc=Ptyp_poly _} as sty)) ->
11101117 (* explicitly polymorphic type *)
11111118 assert (constrs = None);
11121119 let cty, force = Typetexp.transl_simple_type_delayed !env sty in
···11371144 let ty_var = build_as_type !env q in
11381145 end_def ();
11391146 generalize ty_var;
11401140- let id = enter_variable ~is_as_variable:true loc name ty_var sp.ppat_attributes in
11471147+ let id =
11481148+ enter_variable ~is_as_variable:true loc name ty_var sp.ppat_attributes
11491149+ in
11411150 rp k {
11421151 pat_desc = Tpat_alias(q, id, name);
11431152 pat_loc = loc; pat_extra=[];
···15831592 pattern_variables := [];
15841593 let (val_env, met_env, par_env) =
15851594 List.fold_right
15861586- (fun {pv_id; pv_type; pv_loc; pv_as_var; pv_attributes} (val_env, met_env, par_env) ->
15951595+ (fun {pv_id; pv_type; pv_loc; pv_as_var; pv_attributes}
15961596+ (val_env, met_env, par_env) ->
15871597 (Env.add_value pv_id {val_type = pv_type;
15881598 val_kind =
15891599 Val_unbound Val_unbound_instance_variable;
···15911601 Types.val_loc = pv_loc;
15921602 } val_env,
15931603 Env.add_value pv_id {val_type = pv_type;
15941594- val_kind = Val_self (meths, vars, cl_num, privty);
16041604+ val_kind =
16051605+ Val_self (meths, vars, cl_num, privty);
15951606 val_attributes = pv_attributes;
15961607 Types.val_loc = pv_loc;
15971608 }
···16961707 is_nonexpansive_mod mexp && is_nonexpansive e
16971708 | Texp_pack mexp ->
16981709 is_nonexpansive_mod mexp
16991699- (* Computations which raise exceptions are nonexpansive, since (raise e) is equivalent
17001700- to (raise e; diverge), and a nonexpansive "diverge" can be produced using lazy values
17011701- or the relaxed value restriction. See GPR#1142 *)
17101710+ (* Computations which raise exceptions are nonexpansive, since (raise e) is
17111711+ equivalent to (raise e; diverge), and a nonexpansive "diverge" can be
17121712+ produced using lazy values or the relaxed value restriction.
17131713+ See GPR#1142 *)
17021714 | Texp_assert exp ->
17031715 is_nonexpansive exp
17041716 | Texp_apply (
···17291741 id_mod_list
17301742 | Tstr_exception {tyexn_constructor = {ext_kind = Text_decl _}} ->
17311743 false (* true would be unsound *)
17321732- | Tstr_exception {tyexn_constructor = {ext_kind = Text_rebind _}} -> true
17441744+ | Tstr_exception {tyexn_constructor = {ext_kind = Text_rebind _}} ->
17451745+ true
17331746 | Tstr_typext te ->
17341747 List.for_all
17351748 (function {ext_kind = Text_decl _} -> false
···22522265 Exp.let_ ~loc Nonrecursive ~attrs:[mknoloc "#default",PStr []]
22532266 [Vb.mk spat smatch] sbody
22542267 in
22552255- type_function ?in_function loc sexp.pexp_attributes env ty_expected_explained
22562256- l [Exp.case pat body]
22682268+ type_function ?in_function loc sexp.pexp_attributes env
22692269+ ty_expected_explained l [Exp.case pat body]
22572270 | Pexp_fun (l, None, spat, sbody) ->
22582258- type_function ?in_function loc sexp.pexp_attributes env ty_expected_explained
22592259- l [Ast_helper.Exp.case spat sbody]
22712271+ type_function ?in_function loc sexp.pexp_attributes env
22722272+ ty_expected_explained l [Ast_helper.Exp.case spat sbody]
22602273 | Pexp_function caselist ->
22612274 type_function ?in_function
22622275 loc sexp.pexp_attributes env ty_expected_explained Nolabel caselist
···26702683 let tv = newvar () in
26712684 let gen = generalizable tv.level arg.exp_type in
26722685 (try unify_var env tv arg.exp_type with Unify trace ->
26732673- raise(Error(arg.exp_loc, env, Expr_type_clash (trace, None))));
26862686+ raise(Error(arg.exp_loc, env,
26872687+ Expr_type_clash (trace, None))));
26742688 gen
26752689 end else true
26762690 in
···42754289 List.exists
42764290 (fun attrs ->
42774291 Builtin_attributes.warning_scope ~ppwarning:false attrs (fun () ->
42784278- Warnings.is_active (check "") || Warnings.is_active (check_strict "") ||
42794279- (is_recursive && (Warnings.is_active Warnings.Unused_rec_flag))))
42924292+ Warnings.is_active (check "") || Warnings.is_active (check_strict "")
42934293+ || (is_recursive && (Warnings.is_active Warnings.Unused_rec_flag))))
42804294 attrs_list
42814295 in
42824296 let pat_slot_list =
···43074321 List.iter
43084322 (fun id ->
43094323 let vd = Env.find_value (Path.Pident id) new_env in
43104310- (* note: Env.find_value does not trigger the value_used event *)
43244324+ (* note: Env.find_value does not trigger the value_used
43254325+ event *)
43114326 let name = Ident.name id in
43124327 let used = ref false in
43134328 if not (name = "" || name.[0] = '_' || name.[0] = '#') then
+4-2
typing/typecore.mli
···120120 | Or_pattern_type_clash of Ident.t * (type_expr * type_expr) list
121121 | Multiply_bound_variable of string
122122 | Orpat_vars of Ident.t * Ident.t list
123123- | Expr_type_clash of (type_expr * type_expr) list * type_forcing_context option
123123+ | Expr_type_clash of
124124+ (type_expr * type_expr) list * type_forcing_context option
124125 | Apply_non_function of type_expr
125126 | Apply_wrong_label of arg_label * type_expr
126127 | Label_multiply_defined of string
127128 | Label_missing of Ident.t list
128129 | Label_not_mutable of Longident.t
129129- | Wrong_name of string * type_expected * string * Path.t * string * string list
130130+ | Wrong_name of
131131+ string * type_expected * string * Path.t * string * string list
130132 | Name_type_mismatch of
131133 string * Longident.t * (Path.t * Path.t) * (Path.t * Path.t) list
132134 | Invalid_format of string
+2-1
typing/typedtreeMap.ml
···219219 let tyexn_constructor =
220220 map_extension_constructor tyexn.tyexn_constructor
221221 in
222222- Map.leave_type_exception { tyexn with tyexn_constructor = tyexn_constructor }
222222+ Map.leave_type_exception
223223+ { tyexn with tyexn_constructor = tyexn_constructor }
223224224225 and map_extension_constructor ext =
225226 let ext = Map.enter_extension_constructor ext in
+13-5
typing/typemod.ml
···470470 in
471471 let params = tdecl.typ_type.type_params in
472472 if params_are_constrained params
473473- then raise(Error(loc, initial_env, With_cannot_remove_constrained_type));
473473+ then raise(Error(loc, initial_env,
474474+ With_cannot_remove_constrained_type));
474475 fun s path -> Subst.add_type_function path ~params ~body s
475476 in
476477 let sub = Subst.change_locs Subst.identity loc in
···844845 let (ext, newenv) = Typedecl.transl_type_exception env sext in
845846 let (trem, rem, final_env) = transl_sig newenv srem in
846847 mksig (Tsig_exception ext) env loc :: trem,
847847- Sig_typext(ext.tyexn_constructor.ext_id, ext.tyexn_constructor.ext_type, Text_exception) :: rem,
848848+ Sig_typext(ext.tyexn_constructor.ext_id,
849849+ ext.tyexn_constructor.ext_type,
850850+ Text_exception) :: rem,
848851 final_env
849852 | Psig_module pmd ->
850853 check_name check_module names pmd.pmd_name;
···968971 (fun () ->
969972 let (trem, rem, final_env) = transl_sig (Env.in_signature true env) sg in
970973 let rem = simplify_signature rem in
971971- let sg = { sig_items = trem; sig_type = rem; sig_final_env = final_env } in
974974+ let sg =
975975+ { sig_items = trem; sig_type = rem; sig_final_env = final_env }
976976+ in
972977 Cmt_format.set_saved_types
973978 ((Cmt_format.Partial_signature sg) :: previous_saved_types);
974979 sg
···15261531 check_name check_typext names sext.ptyexn_constructor.pext_name;
15271532 let (ext, newenv) = Typedecl.transl_type_exception env sext in
15281533 Tstr_exception ext,
15291529- [Sig_typext(ext.tyexn_constructor.ext_id, ext.tyexn_constructor.ext_type, Text_exception)],
15341534+ [Sig_typext(ext.tyexn_constructor.ext_id,
15351535+ ext.tyexn_constructor.ext_type,
15361536+ Text_exception)],
15301537 newenv
15311538 | Pstr_module {pmb_name = name; pmb_expr = smodl; pmb_attributes = attrs;
15321539 pmb_loc;
···19821989 (prefix ^ ".cmi") imports
19831990 in
19841991 Cmt_format.save_cmt (prefix ^ ".cmt") modulename
19851985- (Cmt_format.Packed (cmi.Cmi_format.cmi_sign, objfiles)) None initial_env (Some cmi)
19921992+ (Cmt_format.Packed (cmi.Cmi_format.cmi_sign, objfiles)) None initial_env
19931993+ (Some cmi)
19861994 end;
19871995 Tcoerce_none
19881996 end
···175175 r
176176177177let lookup_module ?(load=false) env loc lid =
178178- find_component (fun ?loc ?mark lid env -> (Env.lookup_module ~load ?loc ?mark lid env))
178178+ find_component
179179+ (fun ?loc ?mark lid env -> (Env.lookup_module ~load ?loc ?mark lid env))
179180 (fun lid -> Unbound_module lid) env loc lid
180181181182let find_module env loc lid =
+2-1
utils/config.mli
···2929val c_compiler: string
3030 (* The compiler to use for compiling C files *)
3131val c_output_obj: string
3232- (* Name of the option of the C compiler for specifying the output file *)
3232+ (* Name of the option of the C compiler for specifying the output
3333+ file *)
3334val ocamlc_cflags : string
3435 (* The flags ocamlc should pass to the C compiler *)
3536val ocamlc_cppflags : string
+3-1
utils/identifiable.ml
···4646 val filter_map : 'a t -> f:(key -> 'a -> 'b option) -> 'b t
4747 val of_list : (key * 'a) list -> 'a t
48484949- val disjoint_union : ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t -> 'a t -> 'a t
4949+ val disjoint_union :
5050+ ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t ->
5151+ 'a t -> 'a t
50525153 val union_right : 'a t -> 'a t -> 'a t
5254
+3-1
utils/identifiable.mli
···5353 (** [disjoint_union m1 m2] contains all bindings from [m1] and
5454 [m2]. If some binding is present in both and the associated
5555 value is not equal, a Fatal_error is raised *)
5656- val disjoint_union : ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t -> 'a t -> 'a t
5656+ val disjoint_union :
5757+ ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t ->
5858+ 'a t -> 'a t
57595860 (** [union_right m1 m2] contains all bindings from [m1] and [m2]. If
5961 some binding is present in both, the one from [m2] is taken *)
+2-1
utils/profile.ml
···310310 | None -> Measure.zero
311311 in
312312 let total = Measure_diff.of_diff Measure.zero (Measure.create ()) in
313313- display_rows ppf (rows_of_hierarchy !hierarchy total initial_measure columns)
313313+ display_rows ppf
314314+ (rows_of_hierarchy !hierarchy total initial_measure columns)
314315315316let column_mapping = [
316317 "time", `Time;
+1-1
utils/terminfo.ml
···2323 | Bad_term
2424 | Good_term
25252626-let setup oc =
2626+let setup oc =
2727 let term = try Sys.getenv "TERM" with Not_found -> "" in
2828 (* Same heuristics as in Misc.Color.should_enable_color *)
2929 if term <> "" && term <> "dumb" && isatty oc