Drup
4f6e4144ff
Add signature payloads for extension and attributes.
2015-12-09 14:26:06 +01:00
Hugo Heuzard
9eca3e4519
Parse arbitrary precision integers ..
...
.. and allow any letter in [g-zG-Z] as modifier (previously 'l','L','n')
Also allow modifier for floats
This give more freedom to ppx rewritters (what about a ppx for zarith)
Checks are performed when translating from Parsetree to Typedtree.
Invalid_literal is raised if the modifier is not recognized ([lLn]?)
Integer_overflow is raised as before.
Lexer: use g-zG-Z for integer literal modifier
Lexer: Allow modifier on float
Clean wrt previous commits
Lexer: use named substring
Cleanup
typo
doc
fix after rebase
rebase on trunk
Update typecore.ml
Fix printast.ml
2015-12-03 17:20:48 +01: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
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
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
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
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
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
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
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
0f1fb19cbe
#6318 : Extend match...with with exception cases. (Patch by Jeremy Yallop, backend part by A. Frisch).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14743 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:49:37 +00:00
Alain Frisch
0b3423ef2c
#6387 : also allow attributes on methods in object types (< m [@foo] : int; ..>).
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14741 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05 11:21:45 +00:00
Jacques Garrigue
b56dc4b3df
PR#5584: merge open extensible types, extension-patch-4.0.2
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 23:08:45 +00:00
Alain Frisch
0f1bb864df
Add support for floating attributes in class structures and class signatures. (Patch by Leo White.)
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14736 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04 20:42:34 +00:00
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
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
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
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
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
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
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
132ff51559
Some preparation for record arguments.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/constructors_with_record2@14505 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-28 17:08:53 +00:00
Alain Frisch
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
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
2086ac55e6
#6246 : allow wildcard pattern as for-loop index. ==> Camlp4 will need to be adapted.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14333 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-12-02 18:00:18 +00:00
Jacques Garrigue
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
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
525ef9d703
Synchronize with trunk.
...
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13897 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-07-16 13:34:30 +00:00
Alain Frisch
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
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
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
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
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