Commit Graph

10679 Commits (0b1575a6b02455d742cdb4e0780089f697a17492)

Author SHA1 Message Date
Gabriel Scherer c7f2f72c07 PR6695: Make Filename use only US-ASCII functions.
The only place that includes changes is the code for checking
the suffix. It is highly unlikely that the change has any
impact at all.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15728 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:16 +00:00
Gabriel Scherer f15f4f3ed8 PR6695: Make sure the compiler only uses ASCII string functions.
This should cover all places involving filenames in the compiler.
There are a few more paths still using Latin-1 in other ways,
e.g. in ocamldoc.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15727 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:14 +00:00
Gabriel Scherer a533618a7a PR6695: Add ASCII counterparts to case-mapping functions.
This updates Char, String, Bytes in the stdlib.

For now, they are hidden from documentation and are only for
internal compiler use.

From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15726 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:10 +00:00
Gabriel Scherer 85b75d7963 PR#6494: Add equal function in modules Big_int, Bytes, Char, Digest, Int32, Int64, Nativeint, Num and String
(Romain Calascibetta)

From: Romain Calascibetta <romain.calascibetta@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15725 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:08 +00:00
Gabriel Scherer c7d7103646 update Changes
From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15724 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:05 +00:00
Gabriel Scherer 062edd2a4b minor filename.mli doc clarification
From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:04 +00:00
Gabriel Scherer fae0140b37 Add optional perms argument to Filename.open_temp_file.
From: Daniel Bünzli <daniel.buenzli@erratique.ch>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15722 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 11:46:02 +00:00
Gabriel Scherer fe758fb897 PR#6616: allow meaningful use of -use-runtime without -custom.
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15720 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 10:45:11 +00:00
Gabriel Scherer 35f02a6db0 PR#6625: pass -linkpkg to files built with -output-obj.
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 10:39:22 +00:00
Gabriel Scherer 57c015ec23 update Changes after cherry-picking from trunk to 4.02
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15717 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 08:26:21 +00:00
Gabriel Scherer e2b662980f testsuite/Makefile.toplevel: make terminal DUMB by default (tests rely on this)
Currently it is not equivalent to do:
  cd testsuite; make one DIR=tests/$foo
and
  cd testsuite/tests/$foo; make
because the latter will not set TERM=dumb and toplevel tests will use
nice escape-code location highlighting instead of ASCII-made squiggly
lines, which breaks the tests.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15716 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 08:26:20 +00:00
Gabriel Scherer 4c5c124785 PR#6466: use "extensible variant" rather than "open" types in error message
(Leo White)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15715 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-21 08:26:18 +00:00
Gabriel Scherer f517bd2947 ocamlbuild: use sets rather than list for cycle-checking
I'm worried the previous algorithmically-naive implementation may
behave badly on larger-scale projects. We still keep a list around to
return results in the exact same order as previously.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15694 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-20 22:21:55 +00:00
Gabriel Scherer 4ace563b9f ocamlbuild: refine circular dependency errors
When reporting a circular dependency, refine the printed filenames to
those that are really part of the cycle -- instead of those that
happened to be traversed during the DFS that found a cycle. This gives
much more readable error messages.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15693 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-20 22:21:54 +00:00
Gabriel Scherer d6189d83a4 Add @since tags on stdlib functions new in 4.02
make_float was added in 4.02
Buffer.(to_bytes, add_bytes, add_subbytes) were added in 4.02.
BytesLabels was added in 4.02.
Digest.(bytes, subbytes) were added in 4.02.
Marshal.(to_bytes, from_bytes) were added in 4.02.
various Pervasives functions were added in 4.02: print_bytes prerr_bytes output_bytes output_substring really_input_string
Printexc.(backtrace_slots, raw_backtrace_slot) were added in 4.02.
Scanf.(ksscanf, kfscanf) were added in 4.02.
Stream.of_bytes was added in 4.02.

From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15687 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:47 +00:00
Gabriel Scherer 3fc3a877f6 Change 'List' to 'ListLabels' in the ListLabels documentation.
From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15686 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:45 +00:00
Gabriel Scherer 010deb2fee Change 'Array' to 'ArrayLabels' in the ArrayLabels documentation.
From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15685 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:43 +00:00
Gabriel Scherer 512d128918 Add sort_uniq to ListLabels.
From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15684 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:41 +00:00
Gabriel Scherer 2799cb2677 Add make_float to ArrayLabels.
From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:40 +00:00
Gabriel Scherer 1e411a376b Fix constructor names in Typedast printing.
From: Drup <drupyog@zoho.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15682 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 17:31:38 +00:00
Jacques Garrigue 583395b0c6 Fix PR#6726: Access to the wrong field of aliased module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15681 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-19 07:20:00 +00:00
Gabriel Scherer d7bac4efb2 PR#6720: pass -g to C compilers when tag 'debug' is set
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15680 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-17 10:36:06 +00:00
Damien Doligez 0bb55ef40b fix type errors (warnings) reported by the C compiler
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15679 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 19:36:35 +00:00
Gabriel Scherer 8b3fdc9dae notes on attributes in pprintast.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15678 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 14:05:02 +00:00
Gabriel Scherer 094ffa726f PR#6717: Pprintast does not print let-pattern attributes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 13:34:46 +00:00
Jacques Garrigue ac6c857df4 add comment for Tobject in Datarepr.free_vars
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15676 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 01:48:09 +00:00
Jacques Garrigue fd2e5d7a52 Fix PR#6716: Assertion failure with existentials + inline records + rows
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15675 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 01:37:44 +00:00
Gabriel Scherer d96b151e0c update .gitignore
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15673 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-14 21:52:01 +00:00
Gabriel Scherer dee24a9dba PR#6560: Wrong failure message for {Int32,Int64,NativeInt}.of_string
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15672 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-14 21:20:51 +00:00
Gabriel Scherer 4fc5d85e9f update Changes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15671 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-14 21:20:50 +00:00
Gabriel Scherer 8be30254e2 ocamlbuild: explicit 'linkpkg' and 'dontlink(foo)' flags
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15670 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-14 20:58:10 +00:00
Gabriel Scherer 322a3105b3 update Changes
From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:36:05 +00:00
Gabriel Scherer 73590cc155 PR6712: Ignore (-traverse) common VCS directories in ocamlbuild.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15668 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:36:03 +00:00
Gabriel Scherer 98af9c90fb Update manpage
From: Hugo Heuzard <hugo.heuzard@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15667 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:36:00 +00:00
Gabriel Scherer b07a685152 Allow Android builds with systhreads support.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15666 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:35:59 +00:00
Gabriel Scherer ac04e860ab Since r10c, Android NDK includes sys/ucontext.h.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15665 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:35:57 +00:00
Gabriel Scherer e88e2bb744 remove unnecessary Obj.magic (Grégoire Henry)
From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15664 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:35:55 +00:00
Gabriel Scherer ecbae19bcc update Changes for custom index operators
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15663 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:14:49 +00:00
Gabriel Scherer 4a80e9da11 Simplify the definition of custom .{} operators
This commits modify the Bigarray syntax extension in order to facilitate the use of custom .{} operators. The compatibility with the existing Bigarray syntax has been preserved as much as possible. However, this commit will break code which use the Bigarray .{}
syntax without opening the Bigarray module first!

Like the previous commit, this commit modifies the parser to desugar bigarray1.{index} to ( .{} ) bigarray1 index. Following the bigarray syntax, the index operator used
in the desugaring changes if the index is a n-tuple:
1-tuple => .{}
2-tuple => .{,}
3-tuple => .{,,}
4 and more tuples => .{,..,}

The bigarray modules has been modified to use this new index operators. Note that this means that these index operators are not anymore accessible without opening the bigarray module.

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:37 +00:00
Gabriel Scherer 7e47735db8 Simplify the use of custom .() and .[]
This commit modifies the parser to use the newly defined .() and .[] operators. It also moves the definition of the standard .() and .[] operator for String/Bytes and Array to the pervasives module.

Before this commit, expressions of the form array.(index) and string.(index) where desugared to Array.get[_unsafe] array index and Strinf.get[_unsafe] string index. The unsafe or unsafe version were chosen depending on the presence of the "-unsafe" compiler option. Such expression are now desugared to ( .() ) array index and ( .[] ) string index respectively. The same desugar operation is applied to array.(index) <- value which becomes ( .()<- ) array index value.

In order to keep the standard semantic for the string and array index operations, these new index operators are defined in the pervasives module using new compiler primitives, e.g.
let .() = "%array_opt_get".
These new primitives are then mapped to safe or unsafe version depending on the
the "-unsafe" compiler option. Consequently, these modifications should have no impact on existing code.

With these modifications, defining custom .() and .[] operators should be easier, at the cost of losing access to the standard index operator for either array or string.

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:34 +00:00
Gabriel Scherer 16bc43219c Add a special syntax for index operators
This commit introduces a new syntax for index operators.
Six core parenthesis operator are added:
.(), .[], .{}, .{,}, .{,,}, .{,..,}.
The .{,}/.{,,}/.{,,,} operators are defined for compatibility with the Bigarray syntax extension.
Each core index operator is available in a access/assignement versions. For instance, .() is declined in
* .() : index operator
* .()<- : indexed assignment operator
The general syntax for these index operators as implemented in the parser is index_operator::= index_operator_core [<-]

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15660 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:32 +00:00
Gabriel Scherer 14ab17aab9 harden testsuite/makefile/Makefile.dlambda wrt identifiers with quotes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15659 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:12:27 +00:00
Gabriel Scherer 789854f643 ocamldebug: fix printing of variables of lazy type
"print a" in ocamldebug when a is a forced lazy value segfaults on all
OCaml versions I tested it on. This comes from the fact that the
debugcomm.ml re-implementation of the Obj module (talking over the
debugging socket) implements Obj.tag without special-casing integers
(that is, testing is_block first), and always assumes its input is
a block.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15658 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 15:33:50 +00:00
Gabriel Scherer 0338871043 rewrite cycle-detection in genprintval.ml to use O instead of Obj
(see previous commit)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 15:33:48 +00:00
Gabriel Scherer ecb299dfa7 rewrite the printing of Lazy values in toplevel/genprintval.ml
The code previously used Lazy.is_val to know whether the value was
already-evaluated (and, in this case, Lazy.force to extract this value
and print it more precisely). But it lies inside a functor that is
instantiated over different implementations of Obj, while
Lazy.{is_val,force} force the use of the Obj module of the standard
library. This could cause segfaults when this code is called from the
debugger, which instantiates it with a different Obj module talking
over a socket.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15656 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 15:33:46 +00:00
Gabriel Scherer f33c14b278 'Did you mean' for instance variables
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15655 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:29 +00:00
Gabriel Scherer bbf039706a 'Did you mean' for unbound method names
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15654 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:27 +00:00
Gabriel Scherer 7a97cb4f72 typecore.ml: minor refactoring
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15653 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:25 +00:00
Gabriel Scherer b6c2247a45 simplify spellchecking of labels in typecore.ml:
By computing the list of valid names at Wrong_name raising point, we
can remove the logic to reconstruct the set of valid names to draw
suggestion from after the fact:
- no spellchecking-related code in the NameChoice functor
- seamlessly extends to fields of inline records (were not spellchecked before)

I made the type of the "wrong name" in the Wrong_name exception more
precise, from Longident.t to string. The rationale is that:
- we only raise this exception when the longident happens to be
  a (Lident str)
- the list of valid names is a list of field or variant names; those
  are strings rather than idents

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15652 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:24 +00:00
Gabriel Scherer 3e7c17695c 'Did you mean' for variables missing on one side of an or-pattern
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15651 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:22 +00:00