* 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.
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.
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.
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
* 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
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.
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}
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.
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.