Commit Graph

560 Commits (376ea015745983a18f8e164be8d35e72b7f0c97b)

Author SHA1 Message Date
Alain Frisch 44c2066055 #5904: improve support for ppx in the toplevel by allowing ppx processors to keep information across calls (through the use of persistent cookies). Also change Ast_mapper.register so that the function that creates the mapper from arguments is executed once the context has been restored.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15314 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-23 14:54:01 +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 047e09748c Cherry-pick 15062,15063,15064 from 4.02 (#6497).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15068 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:46:34 +00:00
Alain Frisch cc9cbfc755 Cherry pick commit 14900 from 4.02 (fix some whitespace and add a few copyright headers), only the in parsing/ subdirectory (it creates conflicts elsewhere).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15067 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:44:18 +00:00
Alain Frisch f84e4047bc Cherry pick commit 14989 from 4.02 (#6463: properly propagate errors raised when creating the mapper (typically, invalid arguments) to the compiler.).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15066 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:42:30 +00:00
Alain Frisch fc7d8cfecc Cherry pick commit 14857 from 4.02.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15065 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-07 09:40:07 +00:00
Damien Doligez 529ad3ed12 PR#6469: -dsource prints Pervasives.(!) as Pervasives.!
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14998 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-07-11 12:07:54 +00:00
Alain Frisch 894af5c4be Fix regression introduced by commit 14809. (Cherry pick commit 14946 from version/4.02.)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14947 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-06-03 09:05:04 +00:00
Gabriel Scherer 9fa17c95a5 temporarily remove %(%) to avoid weaker typing
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14809 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12 15:37:34 +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 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
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
Gabriel Scherer 3dd57a94e3 PR#6397: fix infix (+=) operators after open types merge
(Patch by Leo White)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14754 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-06 19:57:38 +00:00
Alain Frisch f8efbbfc0d Whitespace.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14747 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 13:04:01 +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
Alain Frisch 470131d6b4 Whitespace.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14740 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:08:41 +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
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
Alain Frisch 772a843812 Fix precedence of extension nodes (#6386).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14711 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:05:52 +00:00
Alain Frisch 676497f8cf Fix precedence of extension nodes (#6386).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14710 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:05:22 +00:00
Alain Frisch 99120f2d24 Fix precedence of extension nodes (#6386).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14709 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30 08:05:04 +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
Alain Frisch d2de0d7b18 Revert 14616, 14617. Go back to the original syntax for toplevel directives, only allowing capitalized identifiers in addition to lowercase ones. Split #show into variants #show_val, #show_type, etc, and implement a generic #show which combines all the results.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14697 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-28 08:04:43 +00:00
Alain Frisch c0f862711e Remove Ast_helper.Convenience submodule. This is better located in the ppx_tools package.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14664 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-23 09:54:46 +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
Fabrice Le Fessant e3aaa68105 Add a hook in the lexer for an internal preprocessor
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14631 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-17 20:19:12 +00:00
Alain Frisch cd5e18a8a3 Allow keywords and capitalized longidents as toplevel directives.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14617 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-17 09:23:22 +00:00
Alain Frisch 26a8bc20a7 Support for toplevel primitives with multiple arguments.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14616 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 16:51:37 +00:00
Alain Frisch 8106136bb3 Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14611 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-16 12:40:24 +00:00
Alain Frisch 738c45596c Doc typo.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14603 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 13:06:35 +00:00
Alain Frisch dc9c697804 Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14601 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 12:05:40 +00:00
Alain Frisch 984814d6a1 Support for the let%foo syntax as structure item.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14600 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:40:13 +00:00
Alain Frisch 546c22b67e Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14599 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:28:03 +00:00
Alain Frisch 9fda101899 Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14598 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15 11:27:22 +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 968f3054bb Fix syntax for floating attributes (disable until next bootstrap).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14590 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 14:59:57 +00:00
Alain Frisch 21f4e43c82 Fix syntax for floating attributes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14589 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 14:59:28 +00:00
Alain Frisch f31ba39923 Custom syntax for floating attributes: [@@@id].
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14588 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-14 14:42:41 +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
Gabriel Scherer 91f9569552 Added comments to parsetree.mli
(Patch by Yotam Barnoy)

Specifically, I documented some more obscure features that weren't
obvious from reading the existing comments.

Discussion of these comments can be found on the mailing list at
  https://sympa.inria.fr/sympa/arc/caml-list/2014-04/msg00022.html

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14577 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12 06:56:51 +00:00
Gabriel Scherer 8cade7a36a parser.mly: minor mistake in position of a symbol
(Patch by Frédéric Bour)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14572 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-11 11:26:59 +00:00
Gabriel Scherer 2b9f94b69b PR#6270: remove need for -I directives to ocamldebug in common case
(patch by Josh Watzman)

Add absolute directory names to bytecode format for ocamldebug to use

The need for a long list of -I directives makes interactively using
ocamldebug a pain in the butt. Many folks have solved this with various
`find` invocations or even Python wrappers, but those lead to other
problems when it might include files you weren't expecting (or miss
things you were). But all of this is really annoying since the tooling
should be able to figure out itself, even heuristically, where your
source files are -- gdb gets this right, why can't we?

This patch implements one of the more important heuristics from gdb: you
typically debug on the same machine you built on, so looking for the
source files and built artifacts in the absolute paths where they were
during compilation is a good first try. We write out absolute paths into
a new structure at the beginning of the debug section and then
automatically append those directories into the load path.

This means mean that if you happen to be debugging on a machine
where the original source and build artifacts are *not* available in
their original absolute locations, things will work as before, using the
standard load path mechanism. You can also explicitly use -I to prepend
directories to the load path and override the defaults located by this
new mechanism.

I personally find this makes using ocamldebug much more pleasant :)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-06 15:06:22 +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
Gabriel Scherer 57fe3746f6 Revert "PR#6270: remove need for -I directives to ocamldebug in common case (patch by Josh Watzman)"
There seems to be a problematic interaction with backtrace collection. To test this,
  make world.opt
  cd testsuite
  make one DIR=tests/backtrace/

This needs to be sorted out before the patch can go in again.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14510 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 14:55:06 +00:00
Xavier Clerc dd7bd5b339 PR#6270: remove need for -I directives to ocamldebug in common case (patch by Josh Watzman)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-31 11:48:35 +00:00
Gabriel Scherer 09900da7c0 Pprintast: factorize handling of infix/prefix binders
There was a bug with "external _pipe = ..." in
otherlibs/threads/unix.ml where the identifier _pipe was wrongly
detected as infix and reprinted as "external ( _pipe ) = ...", causing
a syntax error.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14503 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-28 13:55:22 +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
Alain Frisch 2a9373dc4d More robust syntax (in case we add e.g. some 'open' statement before).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14494 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 17:58:22 +00:00