Commit Graph

1232 Commits (e4ec5ee92484a5f796c04b15252a8eb7c9ed4589)

Author SHA1 Message Date
Hannes Mehnert 0bbac97923 use a locale-independent sort 2016-11-08 18:40:52 +00:00
Gabriel Scherer 8972bd0693 PR#7403: fix a bug in Set.map (new in 4.04.0)
(cherry-pick from the 4.04 branch)
2016-11-07 14:51:20 -05:00
Bernhard Schommer bc81c313b0 Added expand to toplevel. (#864)
* Added expand to toplevel.

The toplevel now also accepts -args and -args0. In order to avoid
problems with the overide_args hack now script file is allowed in
expand options.

* Fixed differences between .ml and .mli

* Added missing expand in opttopmain.

* Added some test for broken -args for toplevel.

The test checks whether the toplevel fails if the script file is passed
via args option.

* Corrected test case.

* Updated error case.

Instead of printing the error string, Arg.Bad is raised and a wrapper is
added around the parse_and_expand_dynamic_argv.

* Added begin ... end around try ... with.

* Added working example an strip error path.

* Use sed to remove path and fixed typo.

* Added documentation.

* Also fix typo in reference file.

* Added PR to the corresponding change entry.

* Reworked Changes entry.

* Added new tests and updated documentation.

A script file in a responsefile now only prints an error message instead
of the help.

* Removed duplicated entry.

* Simplified expand logic.

We only remember where the current last expanded option is.

* Use first non_expand position instead.

* Updated error message.
2016-11-07 11:48:56 -05:00
Alain Frisch 69263a9893 Option-returning variants of stdlib functions (#885)
Provide an xxx_opt alternative for functions raising Not_found
and many instances of Failure/Invalid_arg.

The only exception is the rarely used Buffer.add_substitute, where
the [Not_found] can really be interpreted as an error condition.

Most new functions are implemented directly (instead of wrapping the
raising version).  This is for performance reasons and also to avoid
destroying the stacktrace (if the function is used in an exception
handler).  One could instead implement the raising versions on top of
the new functions, but there might be a small penalty.
2016-11-07 16:11:35 +00:00
Gabriel Scherer a029589606 update Changes with 4.04.0 release date 2016-11-07 09:55:12 -05:00
Gabriel Scherer 2217db1ca6 synchronize Changes with 4.04 (#888) 2016-11-04 11:38:29 +01:00
Gabriel Scherer 0eaa3b68a4 minor Changes fix 2016-10-28 11:19:30 -04:00
Xavier Leroy 4c03ef70fd Merge pull request #876 from damiendoligez/fix-gcc-std-option
PR#7377: remove -std=gnu99 for newer gcc
2016-10-27 19:17:56 +02:00
Damien Doligez b4f2b4818f PR#7377: remove -std=gnu99 for newer gcc 2016-10-27 16:36:49 +02:00
Gabriel Scherer a3bfa2aaeb MPR#7364: update @@unboxed changelog to manage user expectations 2016-10-26 10:14:32 -04:00
Thomas Refis d2f4db5df8 don't attach (**/**) comments to any particular node, but leave them as floating (#872) 2016-10-26 14:45:01 +02:00
hendriktews 0bb16e0934 improve installation of additional material (#827)
- install missing mli and cmti files for compiler-libs and otherlibs
- new make target install-compiler-sources to install compiler-libs ml files
2016-10-21 16:40:14 +02:00
Bernhard Schommer 1a74a8b29c
Added change entry. 2016-10-12 17:16:28 +02:00
Bernhard Schommer 64ef11a634 add Arg.Expand (#778)
Add the `Arg.Expand` constructor to `Arg.spec`. This new specification allows the user to expand the `argv` array being parsed, for instance to implement responsefile support.

A new function `Arg.parse_and_expand_argv_dynamic` is added. It takes both `current` and `argv` as references and as mandatory arguments. This function allows the user to access the `argv` array after expansion.

To avoid confusion regarding the `?current` argument of the various parsing functions as well as with `Arg.current`, `Arg.Expand` is only allowed with the new function.

Tests for this PR are added to the testsuite.
2016-10-07 18:28:30 +01:00
Jacques Garrigue 49504101ee Fix PR#7330
(Cherry-picked from trunk, b4b21d6af0032de5ac973ecc4fedeb6763eccf9c.)
2016-10-07 10:22:35 +02:00
Alain Frisch 94493169ac Better error when 'open'ing a module aliased to a functor (#829)
Better error when 'open'ing a module aliased to a functor.

Consider:

    module F(X : sig end) = struct end
    module G = F
    open G

Before this PR:

   Error: This module is not a structure; it has type (module F)

After:

   Error: This module is not a structure; it has type
          functor (X : sig  end) -> sig  end
2016-10-07 08:56:42 +02:00
Sergey Avseyev fd58d736ce Fix 32-bit build on OpenIndiana (#525) 2016-10-05 16:45:18 +02:00
Pierre Chambart 575f20368d Avoid checking twice if divisor is zero (#702)
* Avoid checking twice if divisor is zero

The flambda branch before merging assumed that Pdivint and Pmodint where
already checked when entering Cmmgen. This was not the case anymore
after merging and this change was lost. This fix this overlook by adding
an annotation to the Pdivint and Pmodint primitive telling whether the
division by zero was already checked.

The reason to move the test generation to Closure_conversion in the
flambda branch was to allow the division primitive to be considered as
pure without needing to check for the effective value of the
divisor. This simplified Semantics_of_primitives a lot.

* Bigarray div and mod also carry safety information

* Handle bigint div and mod like int div and mod in closure_conversion

* Update Changes

* Test for divisions by zero

* Turn Pdivbint and Pmodbint argument into an inline record
2016-10-05 16:42:40 +02:00
yallop 7a7a7d81c1 Fix an overflow bug in String.concat (#833)
Fix an overflow bug in String.concat and make the function faster.
2016-10-04 14:01:05 +02:00
Thomas Braibant d8fa186ab4 Add Changes entry for previous commit:
Do not perform compaction if the real overhead is less than expected (#590)
2016-09-27 17:09:06 +02:00
yallop 89aff47a00 Detect integer overflow in Array.concat (#810)
* Check for overflow in caml_array_gather.

* Add a changelog entry for the check for overflow in Array.concat.
2016-09-26 15:06:57 +02:00
Fabrice Le Fessant f872d67d4e Add functions `List.compare_lengths` and `List.compare_length_with` (#760) 2016-09-18 23:14:17 +02:00
Damien Doligez 12bd764da5 add Changes entry for GPR#795 2016-09-16 15:42:08 +02:00
yallop 8dea301503 Fix broken bounds check in Buffer.add_substring (#814)
* Fix the bounds check in Buffer.add_substring to handle overflow correctly.

* Changes entry for Buffer.add_substring bounds check fix.
2016-09-16 10:23:55 +02:00
Gabriel Scherer b28148defc fix minor mistake in previous Changes commit 2016-09-13 21:25:51 +09:00
Gabriel Scherer 09c4aefd54 Changes: two ocamldoc changes moved to 4.04 2016-09-13 19:27:10 +09:00
octachron 788819687f PR#7350: ocamldoc, viewport metadata for html 2016-09-12 22:45:23 +02:00
octachron 142494cd46 PR#7272: ocamldoc, escape blanks outside of <pre>
With this commit, ocamldoc does not escape anymore space characters
within the <pre> </pre> tags and instead escape space and newline
characters inside <code> </code> when a <pre>-like behavior is desired.

Moreover, the type_* files generated by ocamldoc are correctly assigned
a <pre>-like behavior.
2016-09-08 02:21:47 +02:00
octachron 9d7ef6b61e Manual tools: guarded caml_example environment
This commit modifies the manual tool caml_tex2 to catch the status of
the output and raises an error in case of unexpected error of warning
message. Expected errors or warnings must be now marked explicitly.
There are two options to mark these expected errors or warnings:
The first option is to use the new optional parameter of the
`caml_example` environment, e.g.

\begin{caml_example}[warning=3]
  String.capitalize "a word";;
\end{caml_example}

or for an error:

\begin{caml_example}[error]
  1 +. 3.;;
\end{caml_example}

The second option is to use `[@@expect ..]` attribute before `;;` to
override locally the global expected status output:

\begin{caml_example}
  1 + 2 ;;
  1 +. 3. [@@expect error];;
  String.capitalize [@@expect warning 3];;
  3 + 4 ;;
\end{caml_example}

Note that the two options can be combined together, e.g

\begin{caml_example}[error]
  1 +. 3.;; (* an error is expected here *)
  1. +. 3. [@@expect ok] ;;
  1 + 3. ;; (* an error is still expected here *)
\end{caml_example}
2016-09-02 01:01:33 +02:00
Gabriel Scherer 500c3aca0d flush out MPR#7339, GPR#787's Changes entry (0-dimension bigarrays) 2016-09-01 19:19:14 +02:00
Laurent Mazare 079de967a7 Support the '0 dimension case' for bigarrays (#787)
Bigarray: support 0-dimension bigarrays (just a scalar value), with an Array0 module
2016-09-01 19:14:00 +02:00
Gabriel Scherer 32e0b65c0c Merge pull request #784 from Octachron/ocamldoc_short_description_for_txt
MPR#7333: Ocamldoc, use first sentence as a short description for text files in global overviews
2016-08-31 22:34:09 +02:00
Alain Frisch 227bdc6217 Avoid rebuilding cmi_info record when creating .cmti files (#781)
Instead of rebuilding cmi_info in Cmt_format.save_cmt, the record
created in Env.save_signature is kept and passed to that function.  In
addition to simplifying the code, this avoids possible mismatch between
the two records, including:

  - Duplicated entry in cmi_crcs for the current unit as noted in #744.

  - Missing flags (Unsafe_string/Deprecated were not properly set in
    Cmt_format).

The interface is also stronger, since the signature passed to save_cmt
was supposed to be already mapped by Subst.for_saving but this was not
reflected in the API.
2016-08-30 13:11:01 +02:00
octachron 9cca221a07 PR#7333, ocamldoc: short description for txt files 2016-08-28 22:11:42 +02:00
alainfrisch 361c56c657 Improve Changelog message. 2016-08-26 09:20:48 +02:00
Hongbo Zhang bda66837a5 fix ocamllex -ml, works with -safe-string option (#750) 2016-08-26 09:11:55 +02:00
alainfrisch 722e6e93fc Whitespace. 2016-08-26 09:09:45 +02:00
alainfrisch ef4db2c430 Changelog for #762, #764. 2016-08-26 09:09:13 +02:00
Andreas Hauptmann 9d4833d604 PR#7265: restore 4.02.3 behavior of Unix.fstat on Win32 (#769)
Unix.fstat was broken in 4.03 on Windows when the file descriptor didn't wrap a regular file. This patch restores the 4.02.3 behavior as well as preventing a NULL pointer to be passed to caml_strdup.
2016-08-19 14:09:35 +01:00
David Allsopp df5f1f1edf PR#7300: heap access in Win32 Unix.sleep (#725)
OCaml heap accessed inside a blocking section.
2016-08-18 11:50:07 +01:00
Damien Doligez f70c62d80d Merge pull request 596 from Hongbo Zhang
make string/bytes distinguishable in the underlying compiler implementation
2016-08-08 17:03:20 +02:00
Hongbo Zhang be6533150a fix change logs 2016-08-08 09:16:05 -04:00
Gabriel Scherer ac7efda7b9 Changes: 'empty documentation comment' goes to the Tools section 2016-08-08 14:43:59 +02:00
Hongbo Zhang a36cd4c4ec add needed lambda IR for safe string 2016-08-07 11:07:10 -04:00
Gabriel Scherer 4aef4cea63 PR#7315: refine some error locations (#736) 2016-08-04 10:50:27 +02:00
alainfrisch 5e7c369eb8 Changelog. 2016-08-01 17:30:48 +02:00
Mark Shinwell 40c4e45bd4 Changes entry for GPR#714 2016-08-01 15:22:28 +01:00
Mark Shinwell 787c24a907 Je m'appelle Mark 2016-08-01 15:16:59 +01:00
Damien Doligez 0b4fbc2b30 fix whitespace, long lines, headers 2016-08-01 16:06:59 +02:00
Damien Doligez 60aff732d1 Merge #562: Add a kind of finalisation function called without argument 2016-08-01 11:23:13 +02:00