Commit Graph

648 Commits (ec8203077a47324195d33d65189402e69a2e66dc)

Author SHA1 Message Date
Alain Frisch 4c48d802cb #6612: attribute in type expressions bind less then product types; attributes come after constructor/field declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-11 14:57:20 +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
Jérémie Dimino dc7e685a40 Fix pretty-printing of inlined records
Attributes on label declarations were ignored


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-30 16:24:18 +00:00
Alain Frisch 9bf9d90258 Merge https://github.com/ocaml/ocaml/pull/134: Fix (and simplify) pprintast for optional arguments in types.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15772 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-09 08:31:46 +00:00
Alain Frisch 1be542d948 Fix #6679 (pprintast bug around constraint).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15765 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-01-07 11:34:03 +00:00
Damien Doligez ae7b68f230 PR#6663: A misleading typo in parsetree.mli
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-23 16:52:51 +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 8b3fdc9dae notes on attributes in pprintast.ml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15678 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 14:05:02 +00:00
Gabriel Scherer 094ffa726f PR#6717: Pprintast does not print let-pattern attributes
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-16 13:34:46 +00:00
Gabriel Scherer e88e2bb744 remove unnecessary Obj.magic (Grégoire Henry)
From: Gabriel Scherer <gabriel.scherer@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15664 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:35:55 +00:00
Gabriel Scherer 4a80e9da11 Simplify the definition of custom .{} operators
This commits modify the Bigarray syntax extension in order to facilitate the use of custom .{} operators. The compatibility with the existing Bigarray syntax has been preserved as much as possible. However, this commit will break code which use the Bigarray .{}
syntax without opening the Bigarray module first!

Like the previous commit, this commit modifies the parser to desugar bigarray1.{index} to ( .{} ) bigarray1 index. Following the bigarray syntax, the index operator used
in the desugaring changes if the index is a n-tuple:
1-tuple => .{}
2-tuple => .{,}
3-tuple => .{,,}
4 and more tuples => .{,..,}

The bigarray modules has been modified to use this new index operators. Note that this means that these index operators are not anymore accessible without opening the bigarray module.

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:37 +00:00
Gabriel Scherer 7e47735db8 Simplify the use of custom .() and .[]
This commit modifies the parser to use the newly defined .() and .[] operators. It also moves the definition of the standard .() and .[] operator for String/Bytes and Array to the pervasives module.

Before this commit, expressions of the form array.(index) and string.(index) where desugared to Array.get[_unsafe] array index and Strinf.get[_unsafe] string index. The unsafe or unsafe version were chosen depending on the presence of the "-unsafe" compiler option. Such expression are now desugared to ( .() ) array index and ( .[] ) string index respectively. The same desugar operation is applied to array.(index) <- value which becomes ( .()<- ) array index value.

In order to keep the standard semantic for the string and array index operations, these new index operators are defined in the pervasives module using new compiler primitives, e.g.
let .() = "%array_opt_get".
These new primitives are then mapped to safe or unsafe version depending on the
the "-unsafe" compiler option. Consequently, these modifications should have no impact on existing code.

With these modifications, defining custom .() and .[] operators should be easier, at the cost of losing access to the standard index operator for either array or string.

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15661 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:34 +00:00
Gabriel Scherer 16bc43219c Add a special syntax for index operators
This commit introduces a new syntax for index operators.
Six core parenthesis operator are added:
.(), .[], .{}, .{,}, .{,,}, .{,..,}.
The .{,}/.{,,}/.{,,,} operators are defined for compatibility with the Bigarray syntax extension.
Each core index operator is available in a access/assignement versions. For instance, .() is declined in
* .() : index operator
* .()<- : indexed assignment operator
The general syntax for these index operators as implemented in the parser is index_operator::= index_operator_core [<-]

From: octachron <octa@polychoron.fr>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15660 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-13 22:13:32 +00:00
Alain Frisch 424d01dc35 #6688: fix comment.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15646 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-12-10 13:39:39 +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
Gabriel Scherer eece1bbe45 Add punning for object copying expressions.
From: Jeremy Yallop <yallop@gmail.com>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15580 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-11-16 17:52:26 +00:00
Jacques Garrigue 792c92d1a0 Fix PR#6615: inconsistent printing and parsing of inline records
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15559 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-17 01:48:12 +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 93863aac89 Factorize code to print constructors.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15508 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-09 12:52:56 +00:00
Gabriel Scherer 44d272a34c Document -ppx option.
From: Peter Zotov <whitequark@whitequark.org>

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-10-04 10:39:29 +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 4c3cd9fb7b Sync with trunk.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15334 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-09-25 15:49:42 +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 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
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
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 2acf7b75f3 #5528: -dsource printer, also fix a bug (present in trunk) when printing GADT constructors with multiple arguments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record3@15082 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-12 14:58:56 +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
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 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