Commit Graph

1708 Commits (166ba7147983c961f5cb220fe3222b59d68c75e2)

Author SHA1 Message Date
Leo White 6ee0712423 Put back option in persistent struct hashtable 2015-11-04 11:01:33 +00:00
Leo White 74215da003 Fix PR6998 2015-11-04 11:01:33 +00:00
Leo White 9feda5c10a Merge pull request #264 from lpw25/better-alias-errors
Better -no-alias-deps errors
2015-10-26 11:23:56 +00:00
Leo White 99ad68d256 Improve error for ill-typed functor application 2015-10-26 10:32:41 +00:00
Gabriel Scherer 54e039901e GPR#42: Add simpler functor type syntax
(Leo White)

Add support for simple functor types of the form:

    S -> T

equivalent to:

    functor (_ : S) -> T

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16546 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 16:24:47 +00:00
Jacques Garrigue b96107d228 fix error in parmatch.ml, observed in testsuite/tests/tools-ocamldoc
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16543 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 12:40:31 +00:00
Mark Shinwell 8f7f3162a7 Fix text of message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16535 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 14:36:56 +00:00
Jacques Garrigue a335b18a45 merge branches/gadt-warnings
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16532 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-23 08:33:44 +00:00
Leo White 15cc266e2f Better -no-alias-deps errors 2015-10-22 17:11:08 +01:00
Gabriel Scherer 41a8aa5771 PR#7012: hint when using [ 'A | 'B ] instead of [ B ]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16519 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-17 13:46:02 +00:00
Gabriel Scherer c23132d6fc Revert "PR#7012: hint when using [ 'A | 'B ] instead of [ B ]"
(Sent the wrong patch version)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16518 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-17 13:46:00 +00:00
Gabriel Scherer 88fe01cc5b PR#7012: hint when using [ 'A | 'B ] instead of [ B ]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16517 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-17 13:42:00 +00:00
Jacques Garrigue 211888ed03 Fix PR#6907: always mark all loops...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16513 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 15:00:46 +00:00
Alain Frisch 3856cd00c5 Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16512 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 14:55:15 +00:00
Alain Frisch 935b2300b9 Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16511 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 14:48:16 +00:00
Jacques Garrigue 8ff158b81c Fix PR#6954: subtleties of expansion...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16509 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 14:03:04 +00:00
Jacques Garrigue bea2f16ec8 Fix PR#7016: occur check must handle existing recursive types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16508 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 10:25:08 +00:00
Jacques Garrigue e34f40ad87 switch to 'pat -> .' and add P/Texp_unreachable
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 00:13:40 +00:00
Jacques Garrigue 4188f0543d mark empty matches as Partial
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:59:28 +00:00
Jacques Garrigue 6c7ced53a0 check unused cases if some of them are refuted, even when warnings are disabled
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:53:56 +00:00
Jacques Garrigue b784b65925 add distinct warning for unreachable cases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16504 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 15:39:59 +00:00
Alain Frisch a21eaeaa40 GPR#254: @ocaml.arg_on_literal_pattern attribute on constructors
to warn when the argument is matches against a constant pattern.
This attributes is applied on predefined exception constructors
which take an purely informational (with no stability guarantee)
message.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 12:30:10 +00:00
Jacques Garrigue a09fb037ac add refuted cases, syntax is 'pat -> _'
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 01:55:52 +00:00
Jacques Garrigue e6075fd1e3 recursive expansion for single cases
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16496 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-13 12:38:07 +00:00
Jacques Garrigue bcddc5aa37 make exploding depth explicit
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16495 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-13 09:53:27 +00:00
Jacques Garrigue 0a4f57d5b7 Fix PR#7012
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16489 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-10 07:22:35 +00:00
Gabriel Scherer 489dbbd440 Correction of spelling errors in comments
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16483 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:53 +00:00
Gabriel Scherer 5383003075 Delete french metacomments on missing comments
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16476 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:41 +00:00
Gabriel Scherer 3724c2e00e Delete historical french todo from 1997
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:39 +00:00
Gabriel Scherer 5882fdea22 General translation of french comments
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:38 +00:00
Jérémie Dimino 4098845132 Don't allow "noalloc" together with [@@noalloc]
To avoid confusion about how the "noalloc" is to be interpreted if
both are present.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16461 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:28 +00:00
Jérémie Dimino bd21592814 Deprecated warning for "float" and "noalloc"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16460 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:27 +00:00
Jérémie Dimino 95802fe702 Accept unboxed, untagged and noalloc prefixed by "ocaml."
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16459 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:27 +00:00
Jérémie Dimino e982d6906e Update printing of externals
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16457 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:25 +00:00
Jérémie Dimino 695a592d48 Support [@@noalloc] on external declarations
This is to replace the "noalloc" annotation.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16454 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:20 +00:00
Jérémie Dimino 2c636c5a4f Support [@@unboxed] and [@@untagged] on external declarations
Same as adding [@unboxed]/[@@untagged] to all arguments and the
result. This is to replace the "float" annotation.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16453 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:19 +00:00
Jérémie Dimino d24221cb5f Use Attr_helper in typing/typedecl.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16452 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:18 +00:00
Pierre Weis 10d5bf3724 The proper way to escape @ in a format string is %@ not deprecated @@...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16442 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 18:30:01 +00:00
Jérémie Dimino acd6067a52 Escape '@' in format strings passed to Format.fprintf
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16441 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-22 15:07:19 +00:00
Jacques Garrigue cf303fcc8b Fix PR#6992
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16427 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-18 13:46:56 +00:00
Jacques Garrigue f5bf4bdce1 Fix PR#6993: allow recursive types when doing unification on GADT indices
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16426 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-18 09:55:18 +00:00
Damien Doligez b860d63145 whitespace cleanup, cut long lines, add some missing headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16415 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-11 11:58:31 +00:00
Jacques Garrigue ceb8ceca82 Fix PR#6985
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16413 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-10 02:34:04 +00:00
Jacques Garrigue a0f6145be5 Fix PR#6944
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16412 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-09 09:17:02 +00:00
Jacques Garrigue 8873757fb1 partial fix of PR#5780
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16411 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-09 08:51:02 +00:00
Jacques Garrigue 65435149d2 Fix PR#6982
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16410 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-09 06:37:16 +00:00
Jacques Garrigue 3b0837181f make all
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16404 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 18:49:52 +00:00
Jacques Garrigue 9fb224a836 slightly more efficient redundancy check
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16403 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 16:00:19 +00:00
Jacques Garrigue e2c5a47a95 redundancy check now works / complement of exhaustiveness
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16402 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 10:03:02 +00:00
Jacques Garrigue 254ab1d1b6 check for unused cases due to GADTs
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16400 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-02 08:53:47 +00:00
Jérémie Dimino be482e40d5 Update printing of externals with [@unboxed] or [@untagged] attributes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16383 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 16:18:48 +00:00
Jérémie Dimino 1d196f4ddd Support [@unboxed] and [@untagged] attributes
Adding [@unboxed] (resp [@untagged]) on a primitive argument means
that the argument must passed unboxed (resp untagged) to the external
function. Adding [@unboxed] (resp [@untagged]) on the result means
that the external function returns its result unboxed (resp untagged).

The unboxing (resp untagging) method is derived from the type.

Currently unboxing is suported for: float, int32, int64 and nativeint.
Untagging is supported for int.

This patch also increases the cm{i,o,a,x,xa} magic numbers as the type
Primitive.description is changed.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16382 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-08-25 16:18:46 +00:00
Xavier Leroy bb86f5b545 Preliminary support for hexadecimal notation for FP numbers.
- Primitives:
     caml_float_of_string  extended to recognize "0x" hexa notation
     caml_hexstring_of_float  new primitive
  We do not assume hex floats are supported by the C standard library.
  Instead, conversions hex string <-> float are implemented manually.
- Printf: hex FP output supported with formats %h / %H
- Scanf: remains to be updated (see TODO in stdlib/scanf.ml)


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/hex-float@16257 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-26 09:29:33 +00:00
Damien Doligez 3e17d04ef0 PR#6931: Incorrect error message
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16235 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-22 14:04:39 +00:00
Damien Doligez bb06fe030f fix merge regression on nonrec
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16232 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-22 13:12:44 +00:00
Damien Doligez 860c670848 merge branch 4.02 from 4.02.1 (rev 15540) to a few fixes after 4.02.2 (rev 16205)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16214 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-07-17 14:31:05 +00:00
Leo White 5c55e4cc08 Attach documentation comments to Parsetree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16189 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-28 13:11:50 +00:00
Jacques Garrigue fbcfd218f1 Fix PR#6899
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16184 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-23 08:40:10 +00:00
Jacques Garrigue b650a13145 Fix PR#6897 as suggested by Alain
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16176 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-17 11:09:49 +00:00
Jacques Garrigue d953f6e079 Fix PR#6886
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16152 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-06-03 22:53:25 +00:00
Gabriel Scherer e9785253b2 PR#6876: improve warning 6 by listing the omitted labels.
(Eyyüb Sari)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16137 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-24 07:33:32 +00:00
Jacques Garrigue f1bcf0eb6d use or-patterns in exhaustiveness warnings when possible
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16136 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-21 03:29:47 +00:00
Jacques Garrigue 1585a95502 Fix PR#6874 by pushing module pattern bindings together with default arguments; also merge functions in Simplif.simplify_lets.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16135 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-21 00:22:46 +00:00
Jacques Garrigue c88f3d0634 Improved exhaustiveness warnings for GADTs, with non-deterministic in type_pat
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16133 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-19 22:52:21 +00:00
Jacques Garrigue bf2c5c3c17 Fix PR#6870
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16122 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-17 03:07:10 +00:00
Jacques Garrigue 6f5241de44 Fix PR#6872
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16121 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-17 02:36:30 +00:00
Alain Frisch 090eac18c5 Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16113 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-12 14:37:43 +00:00
Jacques Garrigue 691aabb723 Fix PR#6849 and PR#6862
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16102 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-09 02:17:36 +00:00
Damien Doligez 8a08ad4b4d PR#6600 (cont.) [applying patch on behalf of garrigue]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16079 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-05 15:53:37 +00:00
Gabriel Scherer 0d3d003198 GPR#168: fix bad interaction of warning 34 (unused type declaration) with "nonrec"
(Frédéric Bour)

Typechecking of nonrec types was still looking for uses in the temporary environment.
This made the compiler fail with "exception Not_found" when warning 34 was enabled.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-01 21:45:10 +00:00
Gabriel Scherer 31d5ca0d05 PR#6843: weak dependencies recorded even when .cmi missing
(Leo White, Gabriel Scherer)

The save_pers_struct auxiliary function is only there for code
readability: it helps makes add_import's usage more localized, as now
only *_pers_struct function use it directly.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16060 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-05-01 17:17:34 +00:00
Jacques Garrigue 721266bf30 Fix PR#6842: export Typemod.modtype_of_package
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16033 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-23 07:07:43 +00:00
Jacques Garrigue ebbf345d29 Fix PR#5663: program rejected due to nongeneralizable type variable that appears nowhere
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16029 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-22 07:12:49 +00:00
Jacques Garrigue 3b1a33c77b PR#6672: Unused variance specification allowed in with constraint
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16024 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-20 07:57:51 +00:00
Jacques Garrigue 00e7279141 Fix PR#6836: Assertion failure using -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-13 07:17:22 +00:00
Damien Doligez 53d553112b PR#6827: prefer string to bytes with -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15987 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-07 18:49:50 +00:00
Fabrice Le Fessant ccfec3a1dc Add location info on Tcoerce_primitive
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15984 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-04-03 16:40:24 +00:00
Damien Doligez 6564974ee9 fix bug reported in https://github.com/ocaml/ocaml/pull/149
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15968 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-26 16:43:43 +00:00
Jacques Garrigue 4650c62f8b wrong commit
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15965 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-26 02:04:22 +00:00
Jacques Garrigue aa5422cdeb Fix PR#5545, cleaner use of generalize_spine
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15964 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-25 23:25:52 +00:00
Jacques Garrigue d2bed28077 Fix PR#6817
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15959 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-25 01:49:07 +00:00
Jérémie Dimino 6552e6df8d Fix printing of nonrec types
By allowing Trec_next after Trec_not. Also renamed some functions with
more explicit names:
- map_rec'  -> map_rec_type
- map_Rec'' -> map_rec_type_with_row_types


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15943 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-16 17:41:56 +00:00
Jérémie Dimino 321e95804c Fix printing of sequence of type delcarations with -short-paths
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15942 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-16 17:38:38 +00:00
Jérémie Dimino a700f40252 Update printing of nonrec types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15924 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:09:19 +00:00
Jérémie Dimino bcc9e6adfa Update ocamldoc and other utilities to support "type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15923 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:09:08 +00:00
Jérémie Dimino 65e605a7f2 Support non-recursive types
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15921 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:08:30 +00:00
Jérémie Dimino 51ba396328 Add rec_flag to type items in the parsetree and typedtree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15918 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:07:29 +00:00
Jacques Garrigue 73756628c0 fix PR#6812
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15917 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 03:58:38 +00:00
Alain Frisch 11333d938c #6583: support for custom #... binary operators (also allowing '#' in trailing symbols, although the operator is then rejected by the type-checker).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15892 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-09 17:39:50 +00:00
Gabriel Scherer 1ecdd68c21 untypeast: small change to avoid producing new compiler warnings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15889 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:37 +00:00
Gabriel Scherer ad85a8c1df use open recursion in untypeast.ml
This allows library user to override the untyping behavior of specific
typedtree nodes.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15888 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:35 +00:00
Gabriel Scherer 786e69e846 move tools/untypeast.ml to typing/untypeast.ml
This makes them available in compiler-libs, enabling various uses
outside the compiler.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15886 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 10:22:32 +00:00
Gabriel Scherer 3ad7f526a2 PR#6452, GPR#140: add internal support for custom printing formats
(Jérémie Dimino)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15884 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-08 09:36:10 +00:00
Jacques Garrigue 22a3f9fc16 Fix PR#6787
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15851 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-19 09:57:41 +00:00
Jacques Garrigue a5252548c6 Fix PR#6768: Typechecker overflow the stack on cyclic type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-02-05 07:47:14 +00:00
Jacques Garrigue 410a8b599d Fix PR#6752: scope escaping due to reference inside a module
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15783 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 03:58:11 +00:00
Jacques Garrigue 21bec6fb4b Fix PR#6171: Error message confusing for the beginner when a type escapes its scope.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 03:26:54 +00:00
Jacques Garrigue 1bb0491e64 partial fix of PR#6744
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15781 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-17 00:44:02 +00:00
Jacques Garrigue 64ee2135de Resolve PR#6742: remove duplicate virtual_flag information from Tstr_class
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15776 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-16 09:20:13 +00:00
Jacques Garrigue 838d099258 PR#6600: make -short-paths faster by building the printing map incrementally
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15775 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-16 02:04:17 +00:00
Alain Frisch 6f2bb2922c Fix #6748 (bug in tast_iter, some module coercions were not rewritten).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15773 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-15 11:59:18 +00:00
Alain Frisch 6e85c2d956 #6737: also keep attribute with optional argument + default value.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15764 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-06 11:16:23 +00:00
Alain Frisch 8a2030cff1 #6737: fix typedtree attributes on (fun x -> body) expressions).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15763 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-06 11:02:17 +00:00
Gabriel Scherer 055d5ff07f PR#6714: allow [@@ocaml.warning] on most structure and signature items (values, modules, module types)
(Peter Zotov)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15752 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-27 08:44:50 +00:00
Alain Frisch 9d450a05e0 Replace TypedtreeMap with a more standard open-recursion iterator Tast_mapper. Keep TypedtreeMap/Iter for now, for external projects.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15739 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 09:36:41 +00:00
Jacques Garrigue 93bae0cc3a Exhauce PR#6611: remove the option wrapper on optional arguments in the syntax tree
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 09:06:02 +00:00
Jacques Garrigue 158480371a exhauce PR#6367: introduce Asttypes.arg_label to encode labelled arguments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-22 08:45:55 +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 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 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
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 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
Gabriel Scherer 843f152505 simplify the spellcheck functions
- expose the core spellchecking functionality in Misc rather than Typetexp
- remove the too high-order (yet insufficiently parametric)
  Typetexp.spellcheck from the public interface
- rewrite the spellchecking functions for variants and fields in
  Typecore from the Misc functions rather than reusing
  Typetexp.spellcheck

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 14:46:16 +00:00
Alain Frisch a033839139 #6688: allow val declarations as structure items.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15645 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-10 13:37:50 +00:00
Jacques Garrigue 7a52c110b4 Fix PR#6680
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15640 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-08 08:10:55 +00:00
Jacques Garrigue 1453740778 fix PR#6690
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15637 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-08 07:51:10 +00:00
Alain Frisch 77bc51fb82 Avoid an index-out-of-bound fatal error when the primitive name is empty.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15621 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-03 09:40:27 +00:00
Gabriel Scherer 7bacc5beb4 Typedtree: add type information to primitive coercions
This will enable type-directed optimizations during translation of
module coercions.

WARNING: this breaks Typedtree representation, magic number will have to
be adjusted.

From: Frederic Bour <frederic.bour@lakaban.net>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-17 11:55:24 +00:00
Jacques Garrigue dcb6a4dd7e tentative fix of PR#6651
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15576 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-12 11:59:23 +00:00
Jacques Garrigue 18ed39fb36 Fix PR#6650: Cty_constr not handled correctly by Subst
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15574 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-10 09:43:30 +00:00
Jacques Garrigue 5adbb67a45 PR#6648: show_module should indicate its elision (add Osig_ellipsis to outcometree)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15573 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-10 09:09:23 +00:00
Damien Doligez 94dfb61c09 fix a bug where the .annot files were truncated because of a missing "close"
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-29 21:18:14 +00:00
Damien Doligez 031cffd155 merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-15 13:34:58 +00:00
Alain Frisch e3ad818fb5 Reintegrate-merge constructors_with_record5 branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15556 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-14 15:51:30 +00:00
Alain Frisch af330ed939 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:49:39 +00:00
Alain Frisch fbc0356199 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:40:06 +00:00
Alain Frisch 50e0458bc9 Fix.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:32:47 +00:00
Alain Frisch 1abf8e25be Better error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15504 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:30:32 +00:00
Alain Frisch 2a4e45404e Text.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15503 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:28:56 +00:00
Alain Frisch bf7fc7ddd3 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15501 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:15:18 +00:00
Alain Frisch f66fe1d196 Move constructor and label description records to the bottom of Types. Conceptually those records don't belong to the type language, and could very well be declared e.g. in Datarepr instead.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:09:34 +00:00
Alain Frisch 5d66f846ca Improve error message.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15494 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 16:08:06 +00:00
Alain Frisch 0f70276225 Reduce diff with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15493 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 15:56:39 +00:00
Alain Frisch c69e6d10d2 Reduce diff with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15492 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 15:56:20 +00:00
Alain Frisch 7d53335538 Stop propagating manifest on inlined record types created by rebinding of extension constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15491 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 13:57:19 +00:00
Alain Frisch 44e21907a0 Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15489 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 10:36:14 +00:00
Alain Frisch f87ab66c09 Simplify removal of duplicated values in signatures, reusing the same code as for structures (instead of duplicating the logic; also getting rid of a quadratic algorithm).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15488 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 10:31:15 +00:00
Alain Frisch e1eddd80ed Disallow completely inline records on GADT constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15481 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-07 07:36:21 +00:00
Alain Frisch ad32b4dcee Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15460 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:59:45 +00:00
Alain Frisch 37f4743986 Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15459 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:59:37 +00:00
Alain Frisch d8c418d1cc Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15457 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:32:08 +00:00
Alain Frisch 808d3de148 Cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:30:39 +00:00
Alain Frisch 0b2745ed8c Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record4@15454 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:26:58 +00:00
Alain Frisch 02bfe9c1ec Factorize.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15453 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-03 15:24:50 +00:00