Commit Graph

134 Commits (53d1c7c63d139f0b3ef288f72f8ae7ad105e53a9)

Author SHA1 Message Date
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 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 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 3df9fa2762 Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13492 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 14:12:27 +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 523bb6c541 Update.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13490 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-09 13:29:31 +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
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 ef34950863 POC of a metaquotation expander.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13480 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-03 16:29:03 +00:00
Alain Frisch 1ce06c280e Renaming, cleanup.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13478 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-03 14:13:09 +00:00
Alain Frisch e6f98cb1b6 Clean up lifter.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13477 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-03 14:04:57 +00:00
Alain Frisch 5d45f81ebb AST printer based on lifting.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13476 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 15:53:36 +00:00
Alain Frisch 2ba1aff69b Generate a variantizer object, allowing to hook custom behavior.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13475 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 15:43:17 +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 3f2553305e Finish variantizer generator.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13473 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 13:59:28 +00:00
Alain Frisch bc0e2064fa Done TODOs.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13472 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-04-02 12:40:58 +00:00
Alain Frisch 411da2cb46 Example of using Ast_helper to build AST fragments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-29 16:49:05 +00:00
Alain Frisch ec5a284b0a Adding a 'cass' example, combining extension node and quoted string.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13453 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 12:38:23 +00:00
Alain Frisch 1dd5243b54 Document changes to the Typedtree.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13451 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 11:19:36 +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 422b75d398 Example of using attributes from .cmti files in a mini-ocamldoc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13449 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-26 10:32:52 +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 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
Alain Frisch b9ad592ac0 Infix syntax for attributes/extension nodes restricted to expression constructions starting with a (combination of) keywords.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13419 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-22 11:25:52 +00:00
Alain Frisch 734a4b6816 Fix example.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13418 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-21 08:53:42 +00:00
Alain Frisch b0987fd693 Attributes on expresions (etc) are now stored in the expression record, to facilitate pattern matching on structured fragments of AST while ignoring attributes. Introducing a new Ast_helper module to help creating AST fragments.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13381 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 14:59:45 +00:00
Alain Frisch 556d070fdb Adapt examples.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13380 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 09:36:55 +00:00
Alain Frisch 7c4129960b Adapt examples.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13379 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 09:34:02 +00:00
Alain Frisch a483bbaaf4 Experimenting with alternative syntax for extension nodes (as an annotation on the opening keyword/delimiter).
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13378 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 09:17:30 +00:00
Alain Frisch ab2a491ba0 Support attributes on opening delimiter/keyword for all kinds of expressions.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13377 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-08 08:42:53 +00:00
Alain Frisch a9148b249e Typo.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13375 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 15:33:13 +00:00
Alain Frisch cbf93255c5 Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 15:29:30 +00:00
Alain Frisch 07e81b2f0d Examples. Also accept uppercase idents (and some keywords) as ids for attributes/extension nodes.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13373 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 15:29:11 +00:00
Alain Frisch eaf9e3744a It is now possible to start a signature or a structure with a ';;' token and to have two successive ';;' tokens.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13372 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 14:15:23 +00:00
Alain Frisch 72a638757c Stand-alone ("floating") sig_item/str_item attributes now use the
standard syntax for item attributes.  They are recognized at the 
beginning of the signature/structure and after a ";;" token.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13371 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 13:46:44 +00:00
Alain Frisch 63b229658e Remove prefix syntax for attributes.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13368 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-07 13:00:01 +00:00
Alain Frisch 076eca73cc Alternative syntax for some constructions starting with a keyword.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13364 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 14:53:39 +00:00
Alain Frisch 9f8b148761 More doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13363 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 14:29:04 +00:00
Alain Frisch 8055753e58 Typo.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13362 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 13:51:39 +00:00
Alain Frisch 97c5f1a253 Attributes on label in record type declarations.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13361 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 13:51:18 +00:00
Alain Frisch cb3b398308 Document the changes on the branch.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/extension_points@13360 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-03-06 12:57:56 +00:00
Jacques Garrigue d762415084 pprintast
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13287 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-02-01 02:21:21 +00:00
Jacques Garrigue 0212750b67 subtyping of impure functors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13286 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-31 07:01:52 +00:00
Jacques Garrigue 7e1ef88057 fix unsoundness of impure functors with unpack
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13279 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-25 11:09:43 +00:00
Jacques Garrigue 9cf0614300 error message + allow unpack in impure functor body
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13275 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-25 02:11:04 +00:00
Jacques Garrigue 0582aa4f49 very cheap impure (generative) functors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13274 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-01-24 08:31:04 +00:00
Jacques Garrigue 442c84b40a delayed check for absent variant constructors in patterns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-27 01:38:01 +00:00
Jacques Garrigue 9ba15d4e82 do not diff the patch itself
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13159 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-25 04:32:23 +00:00
Jacques Garrigue 5011d90eb8 only need to copy if pattern contains polymorphic variants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13158 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-25 04:28:12 +00:00
Jacques Garrigue 030e9d8f10 propagate type information to patterns, even with polymorphic variants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13147 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-12-21 07:50:19 +00:00
Alain Frisch 0cdf38d6e6 Move ast_mapper.ml to tools/.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13083 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-11-08 14:27:22 +00:00
Alain Frisch e6eefc3af7 Adapt to changes.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13023 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-17 15:40:28 +00:00
Jacques Garrigue 99378f81be introduce local types in patterns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13007 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-12 01:08:23 +00:00
Alain Frisch 631cac94cb Fix.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12932 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-09-18 16:30:32 +00:00
Alain Frisch 6a8f1cbb9a Sync with Lexifi's version of ast_mapper.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12931 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-09-18 15:55:30 +00:00
Damien Doligez 997a678d5e clean up TABs and whitespace
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-30 18:04:46 +00:00
Alain Frisch e81cd4ac29 Automatically wrap fields with Ptyp_poly.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-27 17:11:05 +00:00
Alain Frisch aebeab4cae Polishing.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12768 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 14:32:47 +00:00
Alain Frisch 451fb8ab52 Continue js syntax example.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 13:59:30 +00:00
Alain Frisch 9174ed2a4a Another example: syntax for javascript properties in js_of_ocaml.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12766 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 12:48:39 +00:00
Alain Frisch c0634a67ac One more example: instrument method calls.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12764 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 09:53:48 +00:00
Alain Frisch 0e45ab3961 Continue AST mapper.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12762 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-07-24 08:40:50 +00:00
Alain Frisch 07a3f52d76 Extend ifdef example, with a compile-time getenv.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12655 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-29 10:04:17 +00:00
Alain Frisch 9d32d89108 Better error report.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12654 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-29 09:49:52 +00:00
Alain Frisch 8531a5c8ee Continue demo of ast mapper.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12653 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-29 09:36:32 +00:00
Alain Frisch 60d0694e9f #5634: parstree rewriters (merge with ast_rewriter branch).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12597 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-06-13 08:00:27 +00:00
Jacques Garrigue d8f8f9ee3b keep the text width to 80 columns
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12522 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-05-31 08:07:31 +00:00
Jacques Garrigue 9e744ea2db a patch to allow 'with module type S = ...' and 'S := ...'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12007 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-01-10 04:10:41 +00:00
Jacques Garrigue a18ae2e959 patch to move id creation to the C side
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11974 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-29 06:49:06 +00:00
Jacques Garrigue dd29cb76ea A small patch to call 'bind' for syntax 'let x <- expr in cont'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11959 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-27 08:54:18 +00:00
Jacques Garrigue 7ff9d50434 trim module signatures
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11318 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-15 10:20:50 +00:00
Jacques Garrigue 6cc516aec6 A patch adding primitives to browse types in the toplevel
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11317 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-12-15 07:58:02 +00:00
Jacques Garrigue 6d52c986c1 update patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11216 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-10-05 13:08:21 +00:00
Jacques Garrigue 40f0a5e04c another approach to principality
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11212 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-09-27 22:36:41 +00:00
Jacques Garrigue ac275d142b fix gadt type variables
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11211 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-09-27 06:37:06 +00:00
Jacques Garrigue 5b34aabb04 patch for better module errors
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11209 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-09-22 08:06:43 +00:00
Jacques Garrigue cf1e36f9a9 update patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11208 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-09-22 07:16:52 +00:00
Damien Doligez d9eb848d86 PR#5238, PR#5277: Sys_error when getting error location
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11166 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-08-04 14:59:13 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Jacques Garrigue d34034ca49 remove garbage from patch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11146 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-23 11:39:02 +00:00
Jacques Garrigue e5d0fb1786 patch for keeping variable names
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11145 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-23 11:24:31 +00:00
Xavier Clerc efb3949fef 'testlabl' renamed to 'experimental/garrigue'.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11140 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-21 07:53:50 +00:00