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
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
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
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
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
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
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
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
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
c827f1d94a
Remove debug.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14517 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-01 11:55:19 +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
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
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
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
Alain Frisch
481ee603df
Remove spurious character from error message.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14492 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-26 08:46:12 +00:00
Alain Frisch
63e31394eb
Ensure that record patterns don't miss any field in Ast_mapper (use of optional arguments in Ast_helper makes it too easy to forget some fields).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14484 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-24 10:04:24 +00:00
Gabriel Scherer
3d1c1adaf3
Factor out the grammar productions for functor parameters
...
(Patch by Jeremy Yallop)
Functor parameters can occur in three contexts:
(1) in functor bindings:
module M (X : S) (Y : T) = ...
(2) in anonymous functor expressionms:
functor (X : S) (Y : T) -> ...
(3) in signature expressions
module type T = functor (X : S) (Y : T) -> ...
This patch simplifies the grammar by using common productions
(functor_arg, functor_args) to handle all three contexts, and by
combining the productions for named and unnamed parameters.
As a side effect, unnamed functor arguments are now available in
functor bindings:
module M (_ : S) (_ : T) = ...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14478 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21 13:27:07 +00:00
Gabriel Scherer
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
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
Gabriel Scherer
ad58a2cb57
PR#6054: add support for M.[ foo ], M.[| foo |], etc.
...
(Patch by Kaustuv Chaudhuri)
The following are now supported:
M.[ foo ] abbreviation for M.([ foo ])
M.[| foo |] " " M.([| foo |])
M.{ foo } " " M.({ foo })
M.{< foo >} " " M.({< foo >})
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14431 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-02-04 16:55:20 +00:00
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
Damien Doligez
64dd73a6e0
PR#6165: Alterations to handling of \013 in source files breaking other tools
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14405 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-01-22 13:04:04 +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
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
Alain Frisch
ac5cbb7913
#5808 : allow simple patterns, not only identifiers, in 'let p : t = ...'.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-16 17:34:23 +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
Alain Frisch
15da6d1804
Reports the beginning of the string literal in 'This comment contains an unterminated string literal' errors.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14328 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-11-29 11:35:50 +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
1b73112593
Allow floating attribute in the toplevel. Also allow the empty structure (;;) as a toplevel phrase.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14213 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-10-04 07:54:31 +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
f55565753e
Cleanup.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14187 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 09:06:45 +00:00
Alain Frisch
e1b2a8b193
Get rid of recursion closing functions, being more explicit on the recursion does not hurt.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14186 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:49:46 +00:00
Alain Frisch
7994b4db28
Functions to close the open recursion in Ast_mapper.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14182 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:24:38 +00:00
Alain Frisch
91b2f18ef8
Cleanup ppx API.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14180 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-26 08:03:49 +00:00
Alain Frisch
48edce920b
Switch to a record-based API for Ast_mapper, so that it can be used within the compiler itself (where objects are banned). The class-based version will be shipped as part of the ppx_tools package. Only the ifdef example has been adapted in experimental/frisch.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14178 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-25 15:14:38 +00:00
Alain Frisch
884ca00fdf
Continue cleanup. driver/errors.ml is no longer needed.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:45:03 +00:00
Alain Frisch
8660e346df
Continue.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14119 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 14:34:13 +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
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
71efb4666b
Switch Lexer.Error to the new system.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14107 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-12 11:59:45 +00:00
Alain Frisch
6ad98b3d09
Port Syntaxerr.Error to the new system. Trickier, because of special way to report some errors in the toplevel (is it really worth the trouble?).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14105 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-11 18:10:59 +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
Alain Frisch
202483b02c
Cleanup.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14083 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-10 12:21:45 +00:00
Alain Frisch
c33ca79107
Some more helper functions.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14081 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-09 16:43:59 +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
cb146ec66b
Doc, export a convenience function.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14058 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-03 08:59:23 +00:00
Alain Frisch
411eb41b42
Allow an optional 'when' clause after a pattern payload.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13920 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-22 15:15:07 +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
8df2057b46
Special syntax when the payload of attribute/extension is a single type expression: [@id : T], [%id : T]. Represented internally as (() : T).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13918 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-22 14:04:28 +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
Fabrice Le Fessant
b171e15a12
Fix fix to PR#3679 : discard CR instead of printing a dot
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13771 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-12 15:32:27 +00:00
Fabrice Le Fessant
5d82e6f17f
Fix PR#3679
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-06-12 11:53:38 +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
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
3beb7a5da0
prepend "-" to raw representation of negative constants in patterns
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13697 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-05-21 15:35:16 +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
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
365bcdeadc
Print attributes on types and patterns.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13598 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-23 13:53:47 +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
Alain Frisch
39ce6c23c3
Adapt js_of_ocaml ppx example.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13566 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-18 14:42:46 +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
519ac7daca
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-17 13:48:35 +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
b99a353158
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13545 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 14:40:49 +00:00
Alain Frisch
98ac2156ff
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13544 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 13:31:35 +00:00
Alain Frisch
c3b8fd2ff6
Fix doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13543 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 12:20:57 +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
80c492fe64
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13541 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 10:53:50 +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
4f758291bc
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13539 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 09:31:16 +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
986fb105c1
Doc.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13537 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 09:11:54 +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
da65939641
Reorganize.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13535 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 07:58:04 +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
fc9f8ee63f
Style.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13533 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-16 07:37:16 +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
abeb8c97f2
Document when Ptyp_poly can appear.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13529 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-15 16:47:27 +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
c16b98ec9f
Document expressions.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13520 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-12 17:20:47 +00:00
Alain Frisch
b22d47ec0f
Document patterns.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13519 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-12 16:53:55 +00:00
Alain Frisch
0c0292340e
Typo.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13518 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-12 16:10:35 +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
Alain Frisch
f7fee51ae3
Example of simple type-driven code generation.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13513 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 15:26:24 +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
8a9188eb3f
Forgot to show attributes.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13510 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 13:28:37 +00:00
Alain Frisch
feb3e48ffe
Continue convenience functions.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13509 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 12:57:59 +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
d5682ed9cf
A -ppx rewriter to evaluate expressions at compile time.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 12:21:02 +00:00
Alain Frisch
94106bf007
Starting to work on printing attributes in pprintast.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-11 07:53:48 +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
91a1d41047
Cosmetic.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13498 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 12:37:56 +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
71787e0228
Support dot-separated attributes for extensions and attributes.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13495 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-10 09:22:54 +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
Damien Doligez
1eda2af37b
fix whitespace
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13483 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-04 15:25:42 +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
8ebf39519e
Allow keywords as extension/attribute identifier.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-03 16:28:36 +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
f510f9b4a1
Support for quoted strings within comments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 15:36:24 +00:00
Alain Frisch
842e50f530
Add entry points to parse expressions/types/patterns.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 09:45:45 +00:00
Alain Frisch
5a0a3605f3
Remove dead code.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13465 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 08:20:12 +00:00
Damien Doligez
129a5b29f5
added a lot of missing newlines
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-28 16:08:54 +00:00
Alain Frisch
180aabbc6b
Simplify.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13452 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 11:29:48 +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
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
ce4d6f7995
fix wrong error message
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13425 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 18:02:34 +00:00
Alain Frisch
f85f1e2759
Get rid of alternative syntax for '(module...)'.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13420 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 11:30:28 +00:00