Commit Graph

66 Commits (e301b9ea321fce0ccc7f9aff75aa3845e5d589d0)

Author SHA1 Message Date
Drup 8a9d074902 Add Ast_helper.Const, for constants. 2016-01-18 00:27:37 +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 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
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
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
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
Jérémie Dimino 7ae6f92e5d Add the "nonrec" keyword and allow it on type
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15919 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-03-13 11:07:57 +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 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 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 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 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
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
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 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
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 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 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 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 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 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 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 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 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 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 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