Alain Frisch
63e31394eb
Ensure that record patterns don't miss any field in Ast_mapper (use of optional arguments in Ast_helper makes it too easy to forget some fields).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14484 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-24 10:04:24 +00:00
Jacques Garrigue
e39065c72b
Optimize Env.find_module further for PR#6350
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14483 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-23 00:06:41 +00:00
Jacques Garrigue
1302703293
Fix PR#6350
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14482 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-22 15:49:57 +00:00
Gabriel Scherer
5f0b7f9a13
[minor] add strmatch to Makefile.nt
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 21:37:05 +00:00
Luc Maranget
d89503fc6b
Oups
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14480 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 18:42:49 +00:00
Luc Maranget
c2a88c27fd
#PR6269 Optimized string matching
...
Noticed that I had to bootstrap to test on ARM, so I commit a new bootstrap
compiler.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 17:02:44 +00:00
Gabriel Scherer
3d1c1adaf3
Factor out the grammar productions for functor parameters
...
(Patch by Jeremy Yallop)
Functor parameters can occur in three contexts:
(1) in functor bindings:
module M (X : S) (Y : T) = ...
(2) in anonymous functor expressionms:
functor (X : S) (Y : T) -> ...
(3) in signature expressions
module type T = functor (X : S) (Y : T) -> ...
This patch simplifies the grammar by using common productions
(functor_arg, functor_args) to handle all three contexts, and by
combining the productions for named and unnamed parameters.
As a side effect, unnamed functor arguments are now available in
functor bindings:
module M (_ : S) (_ : T) = ...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14478 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 13:27:07 +00:00
Gabriel Scherer
eeae918f35
Pervasives: define [min_int] and [max_int] without assuming that integers are either 31 or 63 bits.
...
(Patch by Jérôme Vouillon)
Js_of_ocaml has 32 bit integers. Currently, it patches the bytecode,
just to get the correct values for [min_int] and [max_int]. It would be
simpler if this was not necessary.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14477 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 16:09:33 +00:00
Gabriel Scherer
5c90eefd88
PR#6184: ocamlbuild: `ocamlfind ocamldep` does not support -predicate
...
(patch by Jacques-Pascal Deplaix)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14476 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 16:05:23 +00:00
Gabriel Scherer
5f67d82896
PR#6187: Add a warning when using -plugin-tag(s) without myocamlbuild.ml
...
(Patch by Jacques-Pascal Deplaix)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 15:54:10 +00:00
Gabriel Scherer
9e410c0cfe
Shorten syntax for functor signatures (patch by Thomas Gazagnaire)
...
```
(* Optional naming of parameter implementation *)
module type X = functor (X:S) -> ...
module type X = functor (_:S) -> ...
(* shortening of functor module signatures *)
module type F = functor (X:S) -> functor (Y:S) -> ...
module type F = functor (X:S) (Y:S) -> ...
```
For consistency reasons, this commits also add shortening of functor implementations:
```
(* shortening of functor implementations *)
module F = functor (X:S) -> functor (Y:S) -> ...
module F = functor (X:S) (Y:S) -> ...
```
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 15:21:00 +00:00
Alain Frisch
05982a5fc7
Fix Makefile.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14473 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 15:03:49 +00:00
Mark Shinwell
4eb7a8a644
fix error in previous register naming patch
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14472 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 14:36:12 +00:00
Gabriel Scherer
ce6e8eeb1c
PR#6349: ocamlbuild.cm{o,x} must not be included in ocamlbuild.cm{a,xa}
...
The bug, reported by Jacques-Pascal Deplaix, was only in trunk -- it
appeared in the bootstrap->Makefile transition.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14471 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 13:31:44 +00:00
Alain Frisch
7578b585a1
Also check sharing of immutable constants.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 13:27:50 +00:00
Alain Frisch
8583d7f9d5
Add non-regression test for #5779 .
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20 13:25:21 +00:00
Alain Frisch
87e2ff9b06
#6345 : better compilation of optional arguments with default values.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-18 16:54:32 +00:00
Mark Shinwell
de489bde2f
improved abstractions for register naming in the native code backend
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14465 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-17 14:39:12 +00:00
Mark Shinwell
583bfd46c2
be explicit when constructing integers that are block headers
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14464 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-17 14:34:00 +00:00
Gabriel Scherer
087993d954
[minor] update Changes
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14463 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-17 09:18:17 +00:00
Gabriel Scherer
d22b112968
ocamllex: user-definable refill actions (patch by Frédéric Bour)
...
The patch introduces a new "refill" action. It's optional and if
unused the lexer specification and behavior are unchanged.
When specified, it allows the user to control the way the lexer is
refilled. For example, an appropriate refill handler could perform the
blocking operations of refilling under a concurrency monad such as Lwt
or Async, to work better in a cooperative concurrency setting.
To make use of this feature, add
refill {refill_function}
between the header and the first rule.
[refill_function] is a function which will be invoked by the lexer
immediately before refilling the buffer. The function will receive as
arguments the continuation to invoke to resume the lexing, and the
current lexing buffer.
More precisely, it's a function of type:
(Lexing.lexbuf -> 'a) -> Lexing.lexbuf -> 'a
where the first argument is the continuation which captures the
processing ocamllex would usually perform (refilling the buffer, then
calling the lexing function again), and the result type ['a] should
unify with the result types of all rules.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14461 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-14 15:39:32 +00:00
Gabriel Scherer
adac89525e
[minor] forgotten Changes entry for 4.01
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-13 09:00:24 +00:00
Alain Frisch
bd7fa181cb
Fix two makeblocks incorrectly marked as Immutable. The lazy-related one is concretely problematic in presence of stronger constant propagation.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14454 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 17:25:19 +00:00
Alain Frisch
1080fec868
Optimization: if a function doesn't use its environment, one can do as if it it doesn't have any free variables, and its closure can be statically allocated (we could be more precise and remove unused free variables from the closure).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14453 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 10:05:02 +00:00
Alain Frisch
ebd01bc49e
#6343 , #5537 , #5573 : improving access to values in nested modules.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14452 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 10:02:31 +00:00
Jacques Garrigue
65b1193406
Fix PR#6307
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14451 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 02:54:02 +00:00
Jacques Garrigue
d59bd570d7
Structural typing of first class modules (cf. PR#6333)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10 02:06:10 +00:00
Alain Frisch
7fead1f37b
#5779 : Revert change on camlinternalOO.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14449 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07 17:10:02 +00:00
Mark Shinwell
1f4de8b799
use -bin-annot when building
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14448 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07 14:47:30 +00:00
Alain Frisch
ccf516168f
#5779 : adopt gasche's sentinel solution.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07 08:16:41 +00:00
Alain Frisch
fd2911be13
Really remove debug output.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14446 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07 08:13:55 +00:00
Jacques Garrigue
75b6553f15
remove debugging output
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07 00:59:10 +00:00
Alain Frisch
4907f6ca76
#5779 : improve support for structured constants (better propagation, sharing, cleaner representation). Also fix #6337 (constants emitted several times).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-06 17:03:16 +00:00
Jacques Garrigue
eaf5646196
Fix PR#6331
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-25 08:16:25 +00:00
Damien Doligez
9d86709547
fix major performance problem on large heaps by making the heap increment proportional to the heap size
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-20 13:04:01 +00:00
Damien Doligez
56e5ff050f
PR#6214: "sed: comment garbled" on make world
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14438 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-19 15:33:29 +00:00
Damien Doligez
29ad65d954
PR#6208: Hashtbl.reset @since 4.00.0
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14437 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-19 15:23:17 +00:00
Damien Doligez
5539f86008
add #includes to declare the functions enter/leave_blocking_section
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14436 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-19 14:39:44 +00:00
Alain Frisch
585d571333
#6328 : use real temporary file names for ocamlyacc under Windows.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14435 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-18 09:01:44 +00:00
Jacques Garrigue
c56d21dc76
Quick fix of PR#6325
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14434 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-17 14:03:54 +00:00
Alain Frisch
7570931930
Fix bug (structure-level attributes and ocamlopt).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14433 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-07 14:09:48 +00:00
Luc Maranget
89a627f55b
PR#6322 Corrected.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14432 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-06 13:30:54 +00:00
Gabriel Scherer
ad58a2cb57
PR#6054: add support for M.[ foo ], M.[| foo |], etc.
...
(Patch by Kaustuv Chaudhuri)
The following are now supported:
M.[ foo ] abbreviation for M.([ foo ])
M.[| foo |] " " M.([| foo |])
M.{ foo } " " M.({ foo })
M.{< foo >} " " M.({< foo >})
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14431 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-04 16:55:20 +00:00
Gabriel Scherer
fba6c41771
Fix a typo in close_functions.
...
(Patch by Evgeny Roubinchtein)
The typo isn't a bug since the variables `arity' and `body' are never
actually referenced in the body of the function, but it does
(negatively) affect readability of the code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14430 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-31 07:50:35 +00:00
Alain Frisch
9ef1830a2b
#6311 . Changelog.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14429 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-30 12:21:24 +00:00
Alain Frisch
663c098be6
Add location to module and module type definitions. Improves #6311 .
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14428 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-30 12:18:34 +00:00
Alain Frisch
b81e8ecc3d
#6311 : show kind and location of missing item, in case of signature mismatch.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14427 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-30 09:55:35 +00:00
Jérémie Dimino
67f7b37a7d
release the lock in ftruncate, fchown, and fchmod
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14425 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-29 09:35:06 +00:00
Gabriel Scherer
d78c1fe671
PR#6310: fix ocamldoc's subscript/superscript CSS font size
...
(patch by Anil Madhavapeddy)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14424 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-28 14:43:02 +00:00
Alain Frisch
3fb69be047
Fix testsuite (rely on compilerlibs to be more robust).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-28 14:03:45 +00:00