Alain Frisch
d1b95e90fe
Towards sugar-less encoding of constructor types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-30 08:37:55 +00:00
Alain Frisch
6b080e669e
Towards getting rid of the internal syntactic sugar.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15371 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-29 16:19:00 +00:00
Alain Frisch
6ca707d066
Cleanup.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-29 14:06:20 +00:00
Alain Frisch
e8fd41e2e8
Get rid of type-qualifed constructor paths for extensible types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 16:25:29 +00:00
Alain Frisch
1f203ae846
Disallow multiple declaration of extension constructors with the same name in the same module.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 15:34:06 +00:00
Alain Frisch
1fb70280aa
Cleanup.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15348 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:46:54 +00:00
Alain Frisch
627dda3c43
Merge with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15347 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:35:29 +00:00
Alain Frisch
eb893a5605
Fix merge problem.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15346 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-26 11:32:59 +00:00
Alain Frisch
bd9c17c8d5
Make it clear that type-qualified constructors are only allowed in bang types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25 15:22:06 +00:00
Alain Frisch
5dac90505f
Allow qualified reference to constructors (at least in bang-types). A regular variant type supports qualified constructors of the form: M.t.X. An extensible variant type supports qualified constructors of the form: M.t.N.X.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15332 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25 15:16:19 +00:00
Alain Frisch
4aa48476d8
Refer to the inlined record type as !M.Foo for a constructor M.Foo.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23 16:06:09 +00:00
Alain Frisch
1701d2733b
#5528 : factorize the generation of names for inlined records.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-05 12:24:31 +00:00
Alain Frisch
378a967cb7
Sync with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15190 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-04 16:11:12 +00:00
Alain Frisch
2cf427beb3
#6529 : the checked flag is now part of pers_struct.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15174 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 12:28:48 +00:00
Alain Frisch
adcd0fe5c9
#6529 : further optimize consistency check.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-01 08:36:47 +00:00
Damien Doligez
a18bc7950b
merge changes of version/4.02 from r15121 to r15155
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15168 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-29 17:14:00 +00:00
Gabriel Scherer
d875804d9c
fix minor error-reporting bug
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15141 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-28 21:52:00 +00:00
Damien Doligez
cbfe627f92
merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00:00
Alain Frisch
67151820dc
#5528 : type extensions can create local type names t.A without an explicit local type t (if the extended type is non-local). We must thus check explicitly uniqueness of synthesized type names t.A instead of relying on uniqueness of declared types as before (well, we already had the problem if someone redefined a local exn type).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15083 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 15:40:52 +00:00
Alain Frisch
b115e37fc8
#5528 : improve error reporting.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15081 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:57:13 +00:00
Alain Frisch
9fce02d524
#5528 : improve error reporting.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15080 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:41:50 +00:00
Alain Frisch
9dcd1459fe
#5528 : support rebinding inlined extension constructors with free variables.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15079 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 13:32:23 +00:00
Alain Frisch
bfba47f922
Cherry pick 15071 from 4.02 ( Fix #6510 : Removal of shadowed constructors of extensible types can break the structure of definitions).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15072 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-08 12:17:34 +00:00
Alain Frisch
50f47df33a
Sync with trunk. Rebinding of inlined extension constructors with free variables is not yet supported.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15069 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 16:07:55 +00:00
Gabriel Scherer
d59a10413f
PR#6474: fix the "weak dependencies" support (patch by Leo White)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-06 11:39:21 +00:00
Gabriel Scherer
49d3f7b9f8
PR#6418: support "@[<hov %d>" in the new format implementation (Benoît Vaugon)
...
The bootstrap procedure, as for commit trunk@14973 (see there for
detailed build instructions), requires to first commit a temporary
patch:
> diff -Naur old/typing/typecore.ml new/typing/typecore.ml
> --- old/typing/typecore.ml 2014-06-11 18:16:24.851647309 +0200
> +++ new/typing/typecore.ml 2014-06-11 18:15:50.075646418 +0200
> @@ -2758,16 +2758,9 @@
> let mk_int n = mk_cst (Const_int n)
> and mk_string str = mk_cst (Const_string (str, None))
> and mk_char chr = mk_cst (Const_char chr) in
> - let mk_block_type bty = match bty with
> - | Pp_hbox -> mk_constr "Pp_hbox" []
> - | Pp_vbox -> mk_constr "Pp_vbox" []
> - | Pp_hvbox -> mk_constr "Pp_hvbox" []
> - | Pp_hovbox -> mk_constr "Pp_hovbox" []
> - | Pp_box -> mk_constr "Pp_box" []
> - | Pp_fits -> mk_constr "Pp_fits" [] in
> let rec mk_formatting_lit fmting = match fmting with
> - | Open_box (org, bty, idt) ->
> - mk_constr "Open_box" [ mk_string org; mk_block_type bty; mk_int idt ]
> + | Open_box _ ->
> + assert false
> | Close_box ->
> mk_constr "Close_box" []
> | Close_tag ->
> @@ -2950,6 +2943,19 @@
> mk_constr "Alpha" [ mk_fmt rest ]
> | Theta rest ->
> mk_constr "Theta" [ mk_fmt rest ]
> + | Formatting_lit (Open_box (org, _bty, _idt), rest) ->
> + mk_constr "Formatting_gen" [
> + mk_constr "Open_box" [
> + mk_constr "Format" [
> + mk_constr "String_literal" [
> + mk_string "<>";
> + mk_constr "End_of_format" [];
> + ];
> + mk_string "@[<>";
> + ]
> + ];
> + mk_fmt rest;
> + ]
> | Formatting_lit (fmting, rest) ->
> mk_constr "Formatting_lit" [ mk_formatting_lit fmting; mk_fmt rest ]
> | Formatting_gen (fmting, rest) ->
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14984 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-14 21:08:50 +00:00
Gabriel Scherer
7cb9d0d84e
PR#6418: fix format regression on "@{<..%d..%s..>" (Benoît Vaugon)
...
To be able to compile this patch, you should temporarily apply the
following patch to bootstrap the format type change:
> diff -Naur old/typing/typecore.ml new/typing/typecore.ml
> --- old/typing/typecore.ml 2014-06-06 03:37:03.240926150 +0200
> +++ new/typing/typecore.ml 2014-06-06 03:37:24.696926699 +0200
> @@ -2956,7 +2956,7 @@
> | Theta rest ->
> mk_constr "Theta" [ mk_fmt rest ]
> | Formatting (fmting, rest) ->
> - mk_constr "Formatting" [ mk_formatting fmting; mk_fmt rest ]
> + mk_constr "Formatting_lit" [ mk_formatting fmting; mk_fmt rest ]
> | Reader rest ->
> mk_constr "Reader" [ mk_fmt rest ]
> | Scan_char_set (width_opt, char_set, rest) ->
Bootstrap process:
make core
apply the patch above
make core
make promote-cross
make partialclean
revert the patch above, apply the commit
make partialclean
make core
make coreboot
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14973 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 13:53:47 +00:00
Gabriel Scherer
bb313fa192
Fix PR#6417: sprintf broken when local module named Pervasives is in scope
...
(Backport from Jacques' commit 4.02@14921)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14972 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-09 13:53:45 +00:00
Gabriel Scherer
e0b000527b
format+gadts: make format types "relational" to fix %(...%) typing
...
See the long comment in pervasives.ml for an explanation of the
change. The short summary is that we need to prove more elaborate
properties between the format types involved in the typing of %(...%),
and that proving things by writing GADT functions in OCaml reveals
that Coq's Ltac is a miracle of usability.
Proofs on OCaml GADTs are runtime functions that do have a runtime
semantics: it is legitimate to hope that those proof computations are
as simple as possible, but the current implementation was optimized
for feasability, not simplicity. François Bobot has some interesting
suggestions to simplify the reasoning part (with more equality
reasoning where I used transitivity and symmetry of the
relation profusely), which may make the code simpler in the future
(and possibly more efficient: the hope is that only %(...%) users will
pay a proof-related cost).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-21 13:23:13 +00:00
Gabriel Scherer
74b20bef58
replay trunk@14523: warn on non-principal format6 coercions
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14869 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:17 +00:00
Gabriel Scherer
3ffa399b37
Use a nominal datatype for CamlinternalFormat.format6
...
This should make the type-checking of formats simpler and more robust:
instead of trying to find a pair as previously, we can now use the
path of the format6 type directly.
A nice side-effect of the change is that the internal definition of
formats (as a pair) is not printed in error messages anymore.
Because format6 is in fact defined in the CamlinternalFormatBasics
submodule of Pervasives, and has an alias at the toplevel of
Pervasives, error messages still expand the definition:
> Error: This expression has type
> ('a, 'b, 'c, 'd, 'd, 'a) format6 =
> ('a, 'b, 'c, 'd, 'd, 'a) CamlinternalFormatBasics.format6
> but an expression was expected of type ...
Passing the option `-short-paths` does avoid this expansion and
returns exactly the same error message as 4.01:
> Error: This expression has type ('a, 'b, 'c, 'd, 'd, 'a) format6
> but an expression was expected of type ...
(To get this error message without -short-paths, one would need to
define format6 directly in Pervasives; but this type is mutually
recursive with several GADT types that we don't want to add in the
Pervasives namespace unqualified. This is why I'll keep the alias
for now.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14868 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 15:07:13 +00:00
Jacques Garrigue
14c7fc4a0c
apply patch for PR#6420: Bad error message for non-exhaustive matching on extensible types
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14859 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-14 04:05:21 +00:00
Gabriel Scherer
4907bcf803
typecore.ml: fix format's expected-type mistake
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14826 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:38:07 +00:00
Gabriel Scherer
ee90232220
add typer support for the new formats
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14822 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:59 +00:00
Gabriel Scherer
be3eca64ed
update Benoît's patch wrt. Parsetree changes
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14808 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:33 +00:00
Gabriel Scherer
736876eaea
convert Benoît's first patch to bytes/string
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14807 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:31 +00:00
Gabriel Scherer
43647ba502
first part of Benoît Vaugon's format-gadts patch
...
After applying this patch, you should run:
make library-cross
make promote-cross
make partialclean
make ocamlc ocamllex ocamltools
and then immediately apply the following patches until the "second
part of Benoît Vaugon's format+gadts patch"; the bootstrap cycle is
not finished yet.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14806 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:29 +00:00
Jacques Garrigue
c36565a6c6
avoid warning just before an error happens using -no-alias-deps
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14797 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:42:15 +00:00
Jacques Garrigue
77cf8b999e
* split Typetexp.lookup_module and Typetexp.find_module
...
* fix semantics of -open by using Typemod.type_open_
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14795 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 12:02:26 +00:00
Jacques Garrigue
48ecf7eb15
Fix PR#6410: Error message for an attempt to use a functor as a module is confusing
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 08:13:04 +00:00
Jacques Garrigue
d2194b72fe
comment out Ctype.local_non_recursive_abbrev
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-11 07:48:55 +00:00
Jacques Garrigue
eb2b1f64b1
indentation
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14775 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:40:19 +00:00
Jacques Garrigue
7869662411
disable Clflags.transparent_modules when narrowing unbound identifier error
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14774 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 19:35:54 +00:00
Jacques Garrigue
b6500cc2a4
Fix PR#6405: unsound interaction of -rectypes and GADTs
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14769 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-09 05:46:07 +00:00
Alain Frisch
bfccd68ecc
Protocol to allow ppx processors to report warnings to the compiler (reported as warning 22).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 14:52:19 +00:00
Alain Frisch
f0ef09de26
Expose a Typemod.type_interface (currently an alias of Typemod.transl_signature) by symmetry with type_implementation.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14759 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 12:46:00 +00:00
Alain Frisch
36b25ec2f6
Minor tweak to raw dump of parsetree/typedtree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 11:14:57 +00:00
Jacques Garrigue
88e8bec163
Fix PR#6394: Assertion failed in Typecore.expand_path
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14757 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 10:55:05 +00:00
Alain Frisch
9961e6a1c2
#6399 : protocol (based on a built-in ocaml.error extension node) to let ppx tools send located errors to be reported by the compiler (patch by Peter Zotov).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 08:26:17 +00:00
Jacques Garrigue
1ce29d9bfc
re-commit Leo's weak-dependencies pull request
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14755 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-07 00:34:20 +00:00
Alain Frisch
7e2333051a
ocaml.warnerror built-in attribute.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14753 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:17:09 +00:00
Alain Frisch
0736512709
Revise behavior of ocaml.warning attribute: when used as a floating attribute (in a signature or structure), the scope is restricted to the current signature/structure instead of being global. Also support the new floating attributes in classes, with the same behavior.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14752 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 16:07:44 +00:00
Alain Frisch
110e97d400
When the payload of the ocaml.deprecated attribute is a string, report it as part of the warning message.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14751 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:39:51 +00:00
Alain Frisch
85a176334e
Recognize both prefixed and unprefixed built-in attributes (e.g. ocaml.deprecated or deprecated).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14750 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 14:32:32 +00:00
Alain Frisch
27e9e78637
Accept a fully empty pattern matching. This can be generated by Camlp4 using its revised syntax, and this seems to be used in the wild.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14749 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 17:19:49 +00:00
Alain Frisch
fa3224ec87
Indent + comment.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14744 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:54:34 +00:00
Alain Frisch
0f1fb19cbe
#6318 : Extend match...with with exception cases. (Patch by Jeremy Yallop, backend part by A. Frisch).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:49:37 +00:00
Alain Frisch
0b3423ef2c
#6387 : also allow attributes on methods in object types (< m [@foo] : int; ..>).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:21:45 +00:00
Jacques Garrigue
b56dc4b3df
PR#5584: merge open extensible types, extension-patch-4.0.2
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00
Alain Frisch
0f1bb864df
Add support for floating attributes in class structures and class signatures. (Patch by Leo White.)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 20:42:34 +00:00
Jacques Garrigue
b78b19975a
* Do not require cmi file to be present if module alias is not accessed
...
(using -trans-mod)
* Add warning 49 for that case; use same warning in place of deprecated
for Env.scrape_alias
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14724 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 07:07:09 +00:00
Jacques Garrigue
95104b3924
revert commit 14719
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14723 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-02 06:19:55 +00:00
Mark Shinwell
521ac0213a
weak dependencies with -trans-mod (github/ocamllabs/weak-depends 45e980a,21856a7,merge)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01 12:50:20 +00:00
Alain Frisch
b791d666d8
#6387 : allow attributes on variants in polymorphic variant types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14712 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:19:55 +00:00
Damien Doligez
5b8df637d2
merge branch "safe-string"
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 11:56:17 +00:00
Jacques Garrigue
48f52f450c
merge Leo's patch for PR#6384
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14702 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29 02:25:04 +00:00
Jacques Garrigue
6cb386e91c
Fix PR#6383: Exception Not_found when using object type in absent module
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14701 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-28 13:29:51 +00:00
Damien Doligez
0cba565437
fix some whitespace
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14680 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 22:34:13 +00:00
Jacques Garrigue
979fe8b8ad
Do not add absolute paths for information added to
...
the local environment in Env.components_of_module_make.
Fixes the bug reported by Mark Shinwell on caml-devel,
on 2014-04-23. This bug was related to module aliases.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14674 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-25 09:09:08 +00:00
Alain Frisch
9e23ded0d1
Check unicity of types introduced through exceptions. Do not discard exceptions from signatures if they introduce a type.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 16:09:31 +00:00
Alain Frisch
dfce13de92
Sync with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:40:51 +00:00
Alain Frisch
db015c2670
More precise location on 'name must be unique' error (report the identifier name instead of the whole declaration).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14660 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:34:52 +00:00
Alain Frisch
3b6c0c88a5
Make Parsetree more uniform by keeping locations in all records which have attributes.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14659 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 15:28:20 +00:00
Alain Frisch
af3d4aa91f
Better locations.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14658 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:36:29 +00:00
Alain Frisch
eb617b5fe7
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14657 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:33:41 +00:00
Alain Frisch
307caebc7a
Proper renaming of the ident in Cstr_record during signature substitution.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14656 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 14:14:38 +00:00
Alain Frisch
942046117f
Consider that exceptions with a record argument create an implicit type.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14655 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-22 12:35:02 +00:00
Jacques Garrigue
82e2f35a14
Fix PR#6376
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-21 10:38:04 +00:00
Alain Frisch
c92bbee07d
The type parameters of inlined record types are free variables that appear in the record definition (in order of syntactic appearance), both for GAT and non-GADT constructors.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14640 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 13:20:47 +00:00
Alain Frisch
a527dcf467
Cleanup.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14639 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 13:10:43 +00:00
Alain Frisch
3a89e6804a
Do not register labels of inlined records into the environment; they can only be used through type-based selection. Silence out-of-scope and disambiguated warnings when they are selected.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14638 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18 12:55:10 +00:00
Jacques Garrigue
5db6318900
Fix PR#6371
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14608 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 06:16:05 +00:00
Alain Frisch
6fe5dd7cf4
Turn more sig/str items into records. Patch from Leo White.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14597 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:26:00 +00:00
Alain Frisch
c239f181be
Add back support for explicit_arity mode on constructor expressions and patterns, now relying on an attribute. This has been requested to preserve Camlp5's behavior.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14595 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 09:53:51 +00:00
Alain Frisch
23b1a99802
Use 'ocaml.' prefix for built-in attributes ocaml.warning, ocaml.deprecated. Later, there will be a warning when an unknown ocaml.* attribute is used.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14591 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 15:15:39 +00:00
Alain Frisch
6346154d4b
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14587 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 11:52:29 +00:00
Damien Doligez
7303ac34ca
fix some of the whitespace problems in the source
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 10:17:02 +00:00
Fabrice Le Fessant
2859498cad
Add %loc_* primitives and corresponding values in Pervasives
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14571 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-10 14:11:25 +00:00
Alain Frisch
907c477c02
Produce type equation on exception rebinding with a record argument.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14570 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 17:38:08 +00:00
Alain Frisch
3296c74189
Continue support for record argument on exceptions.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14569 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 16:52:11 +00:00
Alain Frisch
65f986d784
Starting support for exceptions with record arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14568 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 16:14:37 +00:00
Jacques Garrigue
fb74ef5e51
Fix PR#6365
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-09 04:01:26 +00:00
Alain Frisch
632eb11246
For GADT constructors, the type parameters of the original sum type cannot be used for the synthesized record types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14563 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-08 15:52:14 +00:00
Alain Frisch
ef1b5e59cf
Support for GADT constructors with record syntax. For now, do not try to infer a clever variance, nor a predictible ordering, for the extra arguments on synthesized types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14562 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-08 13:48:23 +00:00
Alain Frisch
dc88cf81b8
Polymorphic fields are actually ok.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14561 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-08 13:38:08 +00:00
Alain Frisch
ca1e303b56
Keep the id for the synthesized sub-declaration in Cstr_record.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14560 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-08 13:24:24 +00:00
Luc Maranget
fcf3571123
Folllowup to PR#6359, great cleanup of switch actions sharing.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 15:43:20 +00:00
Alain Frisch
87c8973069
Find the id for local synthesized record types in the environment.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14557 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 15:16:38 +00:00
Alain Frisch
0b0d14e7a0
Fix re-export with a different name.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14554 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 14:58:23 +00:00
Alain Frisch
1d4e1364bd
Keep inlined records in Typedtree and Types. Synthesize record types when inserting in the environment and module components, as for labels and constructors. Following features are not supported: inline record for exceptions, GADTs, polymorphic fields.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@14553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 14:53:30 +00:00
Alain Frisch
e90f525167
Remove debug.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14550 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 13:01:51 +00:00
Alain Frisch
601ba91a29
Printer for exception with inline records.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14549 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 12:53:59 +00:00
Alain Frisch
d416414ccd
Adapt printer.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14548 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07 12:42:49 +00:00
Damien Doligez
e8d15e704c
merge branch 4.01 from 4.01.0 (revision 14115) to branch closure (revision 14525)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14532 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 17:32:35 +00:00
Alain Frisch
fa13304327
Distinguish explicitly representation of regular records and inlined records with tag = 0.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14531 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 12:37:49 +00:00
Alain Frisch
ab7b60aa8d
Support exception rebinding.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14530 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 12:25:21 +00:00
Alain Frisch
1d5122c2ef
Get rid of 'as' clause in inline records. Support re-export of sum types with inline records.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14529 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 08:57:05 +00:00
Jacques Garrigue
fc61342e09
Fix PR#6348
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14528 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-04 04:17:20 +00:00
Jacques Garrigue
2699d155a0
Fix PR#6352
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14524 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-03 03:59:17 +00:00
Jacques Garrigue
12a2e9fa03
comment 9644 of PR#6000: principality check for coercion to format
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14523 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-03 02:52:51 +00:00
Alain Frisch
440a649ba6
Revert bad change included in previous commit, which broke tests/typing-module/firstclass.ml (more phrases were accepted by the type-checker).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-02 20:38:29 +00:00
Alain Frisch
0c4c54c990
Get rid of ocamlcomp.sh. The next step is to share all those common declarations for calling the compilers from various places.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14521 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-02 16:20:38 +00:00
Alain Frisch
6f2fc3f8b0
Allow to give an explicit name (and specify parameters) for inlined records.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14519 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-01 16:15:07 +00:00
Alain Frisch
9b97c9e5c0
Always keep the original type parameters (with ordering) for synthesized record type declarations. Add required existentials, sorted alphabetically.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14518 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-01 12:22:35 +00:00
Alain Frisch
06f465992a
Switch to t.A syntax for synthesized types. Allow the user to refer to such as type.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-01 11:55:01 +00:00
Alain Frisch
d75e2c8b01
Support for record arguments on exceptions.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14515 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-01 11:46:00 +00:00
Alain Frisch
ce4c5fad1d
Rvert parts of the original commit which are not relevant with the encoding approach.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14513 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 16:17:37 +00:00
Alain Frisch
f226f0d26b
Cleanup (use attributes to pass information).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14509 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 14:08:00 +00:00
Alain Frisch
4607a0f8e1
Encode record arguments into extra record declarations.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14508 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 12:20:22 +00:00
Alain Frisch
c36fb6d83e
Type-check constructor creation with a record argument.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-28 17:24:17 +00:00
Alain Frisch
132ff51559
Some preparation for record arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-28 17:08:53 +00:00
Alain Frisch
da5b063687
#6352 : add a warning on implicit removal of optional arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14498 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 18:09:28 +00:00
Alain Frisch
e2493160d0
Get rid of some uses of implicit removal of optional arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14497 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 18:08:51 +00:00
Alain Frisch
6a39aa1e7a
Get rid of some uses of implicit removal of optional arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 18:00:48 +00:00
Alain Frisch
f6b9b99a44
Get rid of some uses of implicit removal of optional arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14495 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 18:00:16 +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
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
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
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
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
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
Alain Frisch
10abdce7b1
Record inclusion checks between value_descriptions in .cmt files. This makes it easy in particular to track in external tools value declarations between implementations and interfaces.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14422 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-28 11:07:02 +00:00
Alain Frisch
9de0cd21fd
#6308 : better error message when the types inferred for a variable on both sides of an or-pattern don't match.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14421 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-27 16:27:05 +00:00
Jacques Garrigue
eaa8a78f94
Fix PR#6303
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-23 01:58:37 +00:00
Jacques Garrigue
950be999e6
Fix PR#6293
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14400 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-14 11:29:02 +00:00
Jacques Garrigue
3b4d7cf63b
Merge module-alias branch (cf. PR#6063)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14394 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-10 07:53:33 +00:00
Jacques Garrigue
d90b126bd4
Add -trans-mod option for transparent module dependencies.
...
Without that option, dependencies are strict, both for
typing and linking.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-20 06:55:26 +00:00
Jacques Garrigue
cfa350c31a
merge generative functors
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14365 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-17 03:52:50 +00:00
Jacques Garrigue
024c8ad498
Fix PR#6275
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14363 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-17 01:39:41 +00:00
Alain Frisch
7b514efefb
Typo.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14346 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-11 14:56:57 +00:00
Alain Frisch
32dddc3f82
#6262 : equality of first-class modules take module type aliases into account. Fix interaction with module inclusion.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14342 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-05 14:57:10 +00:00
Alain Frisch
2086ac55e6
#6246 : allow wildcard pattern as for-loop index. ==> Camlp4 will need to be adapted.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-02 18:00:18 +00:00
Jacques Garrigue
9b974c162f
Fix PR#6241
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14305 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-19 11:07:39 +00:00
Jacques Garrigue
c20af454f3
Fix PR#6240
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14301 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-18 06:44:13 +00:00
Jacques Garrigue
2a011d7095
Fix PR#6240
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14299 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-18 01:26:40 +00:00
Jacques Garrigue
bedaff5138
fix computation of position
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14296 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-16 10:26:19 +00:00
Jacques Garrigue
b4f8172430
also generate module aliases when using include
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14295 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-15 15:19:25 +00:00
Jacques Garrigue
b7ab7460d5
Fix PR#6235 + keep typing of pattern cases independent in principal mode
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14285 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-13 00:16:03 +00:00
Jacques Garrigue
7110a56ab0
expand module aliases and type identifiers in "module type of"
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14282 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11 14:00:38 +00:00
Jacques Garrigue
5d379f7706
use new scrape_alias for Env too
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14281 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11 05:00:10 +00:00
Jacques Garrigue
956e258a12
use a strengthening version of scrape_alias in Typemod
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14279 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-11 03:37:46 +00:00
Jacques Garrigue
04bc532c2b
Fix PR#6174 (-rectypes case)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14248 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-28 12:08:04 +00:00
Jacques Garrigue
09387da800
Fix PR#6174 (non -rectypes)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14246 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-28 11:49:29 +00:00
Jacques Garrigue
8fb5fdc9f2
merge trunk:14244 to fix bootstrap
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14245 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-24 04:19:08 +00:00
Alain Frisch
01aaf23e20
#6205 : add Hint before spellchecking suggestion.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14220 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-10 08:45:40 +00:00
Jacques Garrigue
c628fb2dc9
Do not add module aliases to imports
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14219 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-08 08:18:38 +00:00
Jacques Garrigue
90a081450a
applicative functor application
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14217 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-08 07:14:10 +00:00
Alain Frisch
f1bc74bcc8
#5445 : interpret warning attribute on expressions, and as floating signature/structure items.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 08:18:50 +00:00
Jacques Garrigue
7a904bb8db
make path normalization safer; now Core not only compiles but works
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14212 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 02:06:40 +00:00
Jacques Garrigue
a9ea0064c4
Hurrah: Core compiles (with some warnings)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 16:26:30 +00:00
Jacques Garrigue
c74f7c60e2
fix path comparison. still a problem with FCMod in Core.Binable
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14208 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 13:23:48 +00:00
Jacques Garrigue
251289a3a1
fix exn_rebind: camlp4 compiles again
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14207 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-02 08:34:01 +00:00
Alain Frisch
c955798936
Keep attributes with module type declarations. Warning on reference to deprecated module type.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14206 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 15:14:04 +00:00
Alain Frisch
5554eb13e9
Fix #6193 (Incorrect warning 12 for character ranges).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14205 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 11:40:21 +00:00
Jacques Garrigue
6ffc859a5c
everything works except camlp4
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14204 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-01 03:17:11 +00:00
Jacques Garrigue
eda1266114
passes the testsuite!
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14202 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 15:54:02 +00:00
Jacques Garrigue
5f68db9cf0
Merge trunk at revision 14200. Now everything works except private types
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14201 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 13:54:59 +00:00
Jacques Garrigue
4c5e9bbe6b
mostly works, but:
...
* a strange bug in open
* spurious bindings in the lambda code
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14200 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 11:35:15 +00:00
Jacques Garrigue
e686ed503a
now works with nested structures; still problems inside functors
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14199 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 03:18:47 +00:00
Jacques Garrigue
9ddb346f54
do not alias functor parameters + some problems with coercions not fixed yet
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14198 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-30 02:10:21 +00:00
Jacques Garrigue
e0cdc52ba0
module translation + bad functor example
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14197 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-29 11:49:07 +00:00
Jacques Garrigue
97899f37ca
Support module aliases.
...
Namely, you can write "module L = List" in signatures,
and avoid have the compiler use directly List when you write L.
See examples in testsuite/tests/typing-modules/aliases.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14196 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-29 07:22:34 +00:00
Alain Frisch
cc31694f7c
Keep attributes on module declarations.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 17:05:39 +00:00
Alain Frisch
c0778758c1
Keep attributes/locs for class type declarations and class declarations in Types. Renaming cty -> csig prefix for class signatures to be coherent with Typedtree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14194 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 15:04:03 +00:00
Alain Frisch
645dcf25e5
Keep location and attributes in type, label and constructor declarations. Deprecated warning when a deprecated type or constructor is referenced.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14191 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-27 10:54:55 +00:00
Alain Frisch
6873f39817
Keep attributes on value declarations in .cmi files (but clear all the location fields, except if -keep-locs is used, of course). Use this to report a warning when a value marked as [@@deprecated] is referenced ( #5854 )
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14188 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 15:24:11 +00:00
Alain Frisch
b414d57b0e
Simplify type_structure.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14170 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-20 16:19:54 +00:00
Jacques Garrigue
010728722f
PR#6173: Improve error messages for type-based disambiguation
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-19 07:25:51 +00:00
Alain Frisch
c8d20ade02
Do not track unused type declarations created by 'include'.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14158 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 14:28:31 +00:00
Alain Frisch
40117f7480
#5817 : new compiler flag (-keep-locs) to keep location in cmi files.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14157 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 12:45:05 +00:00
Alain Frisch
9a4a944363
#6182 : better error message for virtual objects and class types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14155 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-17 11:28:33 +00:00
Alain Frisch
2e16ccd61f
Switch Includemod.Error, without trying to split the message (to keep current behavior).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14117 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:21:04 +00:00
Alain Frisch
af5e566d62
Switch Typetexp.Error, Typedecl.Error, Typemod.Error, Typeclass.Error.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14114 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:06:48 +00:00
Alain Frisch
08ed781ecc
Switch Ctype.Tags.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14113 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 13:59:45 +00:00
Alain Frisch
c18155a018
Switch Cmi_format.Error.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14112 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 13:50:36 +00:00
Alain Frisch
de72ef4a89
Simplify common case of unit-wide errors.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14111 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 13:47:04 +00:00
Alain Frisch
6950d6f780
Do not keep file name in exception, after all.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14110 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 13:41:01 +00:00
Alain Frisch
290fe0c0b2
Keep input file in Env.Error. Switch it to the new system.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14109 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 13:00:22 +00:00
Alain Frisch
47be69c2b0
Cherry-picking commit 14093 from trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14104 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-11 16:08:00 +00:00
Jacques Garrigue
d09dee8f9c
Fix PR#6163
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-06 05:35:55 +00:00
Jacques Garrigue
567bca77d2
Fix PR#6158
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14063 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-05 08:26:01 +00:00
Damien Doligez
7844495624
Merge branch 4.01 from branching point to 4.01.0+rc1
...
Command line used:
svn merge --accept postpone -r 13776:14055 $REPO/version/4.01 .
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14060 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-04 15:12:37 +00:00
Alain Frisch
842f6794a9
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@14042 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-28 17:10:04 +00:00
Jacques Garrigue
7a6d827026
Fix PR#6123
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14021 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-08-20 03:00:19 +00:00
Jacques Garrigue
1fc309687a
allow spurious private in with constraint for backward compatibility, but warn
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13953 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-31 02:49:13 +00:00
Jacques Garrigue
47d094db83
Fix PR#6090
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13937 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-26 23:04:51 +00:00
Jacques Garrigue
d3e731774e
Fix PR#5802
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13926 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-24 08:11:20 +00:00
Alain Frisch
b0d5fc28a2
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13922 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-22 17:03:39 +00:00
Alain Frisch
87d9d6c877
More explicit internal representation of attribute payload. Now also support patterns as payload [%id ? pat].
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-22 14:58:15 +00:00
Alain Frisch
d3be8230a7
#6073 : Add signature to Tstr_include. (Cherry-picked from commit 13903 on 4.01.)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13904 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-17 15:25:47 +00:00
Alain Frisch
525ef9d703
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Alain Frisch
f836495698
Fix #5571 .
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13877 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-09 11:16:25 +00:00
Alain Frisch
b4c2dc9336
Remove duplicated declaration.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13872 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-04 12:27:06 +00:00
Jacques Garrigue
07b8b7dd74
Fix PR#6056
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13845 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-28 10:43:25 +00:00
Jacques Garrigue
f4d0232689
fix PR#5914
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13829 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-22 07:31:37 +00:00
Jacques Garrigue
70a5d6af9f
fix a variance bug in GADTs
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-18 13:04:32 +00:00
Alain Frisch
ba38d00535
#5980 : a different warning for shadowing labels/constructors and for other kinds of identifiers. (Cherry-picked from commit 13796 on 4.01.)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13797 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-18 08:01:02 +00:00
Jacques Garrigue
d53e2b57b2
Make GADT inference robust to useless equations
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-17 03:02:14 +00:00
Jacques Garrigue
4fb61c91e6
Fix PR#5815
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-17 02:03:36 +00:00
Alain Frisch
ee8d80e3a9
#6035 : reject multiple declarations of the same method or instance variable in the same object.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-07 15:35:43 +00:00
Alain Frisch
207f9fb7f7
#6030 : Avoid repeated flushes.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13742 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-04 13:46:48 +00:00
Alain Frisch
2e199ef1f2
Item attributes on each let-binding.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 15:14:19 +00:00
Damien Doligez
48f65d07f8
PR#5098: creating module values may lead to memory leaks
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13735 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 14:46:04 +00:00
Pierre Weis
38cac2d847
Move back to revision r13685.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13733 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-03 11:12:31 +00:00
Pierre Weis
cba8ab21e4
Introducing %A and %R conversion. Untabify. Wrong quoting chase.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-29 18:25:05 +00:00
Damien Doligez
e69730e0d6
extend warning 3 to other deprecated features: Latin1, (&) and (or)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13706 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-28 11:05:58 +00:00
Jérémie Dimino
8cee3aedf9
Revert addition of raw literals to the parsetree
...
It turns out it is not possible to have the exact raw representation
since a constant does not always correspond to exactly one token, so
there is no point in making the AST more complex.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13702 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-23 15:12:04 +00:00
Damien Doligez
c3bf54a7b6
merge changes from version/4.00 from 4.00.1 to r13697
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13699 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-22 12:56:54 +00:00
Jérémie Dimino
4e7ae971a7
add the raw representation of constants to the parsetree
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13696 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-20 11:37:41 +00:00
Jacques Garrigue
ccf56e3b2a
fix bug in short-paths: must ignore position when comparing paths
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13695 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-20 03:12:46 +00:00
Alain Frisch
4f24f8ab0f
#5980 : only report shadowing against the environment before the 'open'.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13689 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-17 10:12:31 +00:00
Alain Frisch
a3b1c67fff
#5980 : explicit way to silence the new warning (open! X).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13685 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-16 13:34:53 +00:00
Alain Frisch
f51bc04b55
#5980 : warning on open statements which shadow an existing identifier (which turns out to be actually used in the scope of the open).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13683 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-16 12:36:15 +00:00
Alain Frisch
7fa05e12d4
Fix error message.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13664 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-13 12:15:31 +00:00
Jacques Garrigue
9f105f3cba
protect against Ctype.equal changing the representative
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13651 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-04 10:32:06 +00:00
Jacques Garrigue
c09d328c31
More clever handling of constrained parameters:
...
if the same type appears at the right variance inside
parameters, no need to check its type variables
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-04 08:52:44 +00:00
Jacques Garrigue
ba7fa367a1
Fix PR#6004
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13649 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-04 01:44:49 +00:00
Jacques Garrigue
e2dbb7f516
Fix PR#6005
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13647 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-03 14:40:11 +00:00
Jacques Garrigue
67e18e5c4d
Fix PR#5985 for constrained parameters too.
...
Required more variance information, so variance is now an abstract type.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13645 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-03 13:38:30 +00:00
Jacques Garrigue
cc0daa3c3f
typo in -short-paths
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13641 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-02 01:30:25 +00:00
Jacques Garrigue
bdf9c6bae7
For -short-paths, lookup the whole environment, but avoid recomputation
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13640 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-02 01:02:15 +00:00
Jacques Garrigue
f35c7d123f
Take ambiguity into account when using -short-paths option.
...
Namely, do not use an abbreviated form which doesn't correspond
directly to a physical definition when it might point to
several definitions, due to multiple opens.
Also be careful about not abbreviating types we are defining
in type definitions.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13635 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-30 09:05:26 +00:00
Jacques Garrigue
c425ae1ce8
Fix PR#5985; compute injectivity of types but no new syntax
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13634 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-30 05:26:57 +00:00
Alain Frisch
96fc2316ed
Fix #5965 .
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13619 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-29 15:39:00 +00:00
Alain Frisch
2bbf91ca42
#5832 : patch to improve 'wrong file naming' error messages.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13618 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-29 14:57:38 +00:00
Jacques Garrigue
35d1dde122
Improve message for warning 40
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13612 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-26 13:09:24 +00:00
Luc Maranget
ebfc4e6cff
Fix PR #5992
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13611 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-25 13:32:17 +00:00
Jacques Garrigue
b20679022a
printing of anonymous type parameters after strengthening
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13603 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-24 11:02:49 +00:00
Jacques Garrigue
5f27c34e10
Apply patch from PR#5944
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13588 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-23 00:18:15 +00:00
Jacques Garrigue
a0b6262cf8
Fix PR#5997
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13586 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-22 23:53:24 +00:00
Jacques Garrigue
497ec43277
Fix PR#5993
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13580 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-19 08:48:25 +00:00
Alain Frisch
eb4130e47c
The arument of attributes and extension nodes is now a structure, which is syntactically more general than an expression (through the embedding E -> [Pexp_eval E]).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13579 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-19 07:40:57 +00:00
Jacques Garrigue
39d57e01e6
Fix PR#5989
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13578 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-18 23:41:29 +00:00
Alain Frisch
67912da346
Allow abstract module declaration in structures to make the syntax and Parsetree more uniform.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-18 13:14:53 +00:00
Alain Frisch
84147074f9
Split Pexp_constraint into Pexp_coerce/Pexp_constraint.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13552 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 12:23:44 +00:00
Alain Frisch
d2171a98d8
Split Pexp_function into Pexp_function/Pexp_fun.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13551 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 11:43:29 +00:00
Alain Frisch
b22865d0a9
Check AST invariants.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13550 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 10:01:24 +00:00
Alain Frisch
b36ec9f764
Get rid of the 'explicit arity' flag on Pexp_construct/Ppat_construct. If really requires (for camlp5?), the feature should be reimplemented with attributes.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13549 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 09:46:52 +00:00
Alain Frisch
501dfd2b5e
Getting rid of Pexp_assertfalse/Texp_assertfalse.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13548 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 09:18:03 +00:00
Alain Frisch
088de517d8
Keep interval pattern sugar in the Parsetree (Camlp4 parsers still expand them).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13546 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 15:34:09 +00:00
Alain Frisch
158bc9c9e3
Get rid of the undocumented syntax #c[>`A] ( #5936 , #5983 ).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13542 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 12:17:17 +00:00
Alain Frisch
3fe10139ab
Better representation of with-constraints.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13540 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 10:47:45 +00:00
Alain Frisch
c8743ab55f
Remove pcsig_loc field + doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13538 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 09:21:05 +00:00
Alain Frisch
ecb088015f
Rename Pcty_fun to Pcty_arrow (and idem in Types, Typedtree, Outcometree) to be coherent with Ptyp_arrow.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 08:59:09 +00:00
Alain Frisch
bfc9a8f9e1
Get rid of the location argument on pci_params, and improve location of error messages.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13534 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 07:51:27 +00:00
Alain Frisch
dd200d9553
Allow the method body to be represented by a non Pexp_poly expression in the Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13530 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-15 17:26:32 +00:00
Alain Frisch
e7736899fb
Explicit representation of guards, get rid of Pexp_when.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13528 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-15 16:23:22 +00:00
Alain Frisch
57f1133e0a
Represent the closed flag of Ptyp_variant using closed_flag instead of bool, and start documenting the Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13517 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-12 16:08:52 +00:00
Jacques Garrigue
ff7547dca0
Fix PR#5981
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13514 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-12 10:20:14 +00:00
Alain Frisch
04de43bee5
Attributes on Pstr_eval.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 14:07:32 +00:00
Alain Frisch
92ad47d47b
Keep item attributes on let-binding structure items.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13511 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 13:52:06 +00:00
Alain Frisch
3a5b7fe6b4
Convenience functions to build AST + implicit location.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13508 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 12:50:38 +00:00
Alain Frisch
a929cdb339
Cosmetic.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13503 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 18:00:11 +00:00
Alain Frisch
90bbd25948
Extension nodes as class field or class type field.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:54:54 +00:00
Alain Frisch
6e36fd566b
Extension nodes and attributes for class types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13501 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:44:15 +00:00
Alain Frisch
ee5f754a42
Attributes and extension points in class_expr.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 17:26:55 +00:00
Alain Frisch
e2036c5a22
Start to bring constructor names closer to concrete syntax.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13497 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 11:17:41 +00:00
Alain Frisch
580bb34579
Renaming pcstr_pat -> pcstr_self, cstr_pat -> cstr_self.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 09:35:09 +00:00
Alain Frisch
ec9dacb3f1
Support for attributes on class type fields.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13494 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 09:17:22 +00:00
Alain Frisch
d84ae41182
Item attributes on class fields.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13493 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 15:54:41 +00:00
Alain Frisch
d1751e4738
Allow to not have empty Ptyp_poly node in the Parsetree (the type-checker insert them automatically).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 14:10:54 +00:00
Alain Frisch
1eb1ec4c40
Get rid of core_field_type, more direct representation of object types.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13489 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 13:29:00 +00:00
Alain Frisch
47a3ee095e
Get rid of the Default case in Asttype.rec_flag.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-04 12:38:20 +00:00
Alain Frisch
27d523ea72
Better representation of variance in the Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 15:33:35 +00:00
Alain Frisch
6bfcb1da5b
Support for quoted strings.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 11:17:17 +00:00
Alain Frisch
c2c5b10685
Align module type binding with Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13448 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 08:21:29 +00:00
Alain Frisch
2ffa26af82
Align module binding with Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13447 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 08:09:26 +00:00
Alain Frisch
77d3fce857
Align exception_declaration with Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13446 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:42:45 +00:00
Alain Frisch
f4ca2da467
Align type_declaration with parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:20:11 +00:00
Alain Frisch
25815e6e77
Align typed value_declaration with parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 18:04:40 +00:00
Alain Frisch
fbde1f7e52
Align module and module type declarations between Parsetree and Typedtree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 17:47:28 +00:00
Alain Frisch
0b9347f482
Represent exception declarations as constructor declarations in the Parsetree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 15:49:10 +00:00
Alain Frisch
dd61fb5e55
Represent label and constructor declarations as records in the typedtree. Also keep return type for GADT constructors.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13441 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 14:56:56 +00:00
Alain Frisch
5c98dd91fe
Starting to keep attributes in the typedtree.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13440 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-25 14:16:07 +00:00
Damien Doligez
2cbba4b445
fix whitespace
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13430 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 18:20:25 +00:00
Gabriel Scherer
75b8c0184f
PR#5933 type-specialize 'let compare = compare' on ints and strings
...
According to the reporter 'sliquister', type-specialized comparison
can nearly halve compilation time in some cases. This patch applies
type-specialization throughout the OCaml distribution sources, so not
all changes will have performance utility, but in this case I think
it's best to be consistent, as I see no downside to the change.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13410 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-19 07:22:12 +00:00
Jacques Garrigue
389e3a789b
Fix PR#5948
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-13 04:59:10 +00:00
Jacques Garrigue
32de864a67
improve Ambiguous_name warning
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13395 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-12 14:56:15 +00:00
Alain Frisch
b0987fd693
Attributes on expresions (etc) are now stored in the expression record, to facilitate pattern matching on structured fragments of AST while ignoring attributes. Introducing a new Ast_helper module to help creating AST fragments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13381 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 14:59:45 +00:00
Alain Frisch
97c5f1a253
Attributes on label in record type declarations.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 13:51:18 +00:00
Alain Frisch
d50038cae7
Attribute has structure/signature item.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13359 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:27:32 +00:00
Alain Frisch
2cf65c8c85
Record for module type declarations.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13358 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:14:02 +00:00
Alain Frisch
24a0c6eb0e
Name is part of the value_description record.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13357 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:00:18 +00:00
Alain Frisch
241abe55e6
Type name is part of the type declaration record.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13356 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 11:47:59 +00:00
Alain Frisch
59bdf321d3
Switch Pstr_modtype argument to a record type.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13355 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 10:49:44 +00:00
Alain Frisch
d32b19008a
Parse recursive module as standard modules, and check in the type-checker that an explicit type is provided. (Unfinished.)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-05 16:50:05 +00:00