summaryrefslogtreecommitdiff
path: root/parsing/parsetree.mli
Commit message (Collapse)AuthorAgeFilesLines
* parsetree: explicit type constraints for value bindings (#12119)Florian Angeletti2023-03-241-1/+10
| | | | Add an explicit type constraint field to the Parsetree node for value bindings (`let p : typ = exp`).
* Add syntax for generative functor application (#11984)Richard Eisenberg2023-02-121-1/+2
| | | | | | | | | | | | | | Previously, writing [F ()] was the same as writing [F (struct end)], even though the latter looks like the use of an applicative functor, not a generative one. This commit, originally written by Frédéric Bour <fred@tarides.com>, adds new syntax to our AST to represent generative functor application and propagates this change throughout the compiler. In addition, it adds a new warning, 73, to report when a user has written [F (struct end)] but should now update to [F ()]. Co-authored-by: Frédéric Bour <fred@tarides.com>
* `odoc`ify the parsetree comments (#11107)panglesd2022-03-281-462/+528
| | | | | | * Odocify the parsetree comments Signed-off-by: Paul-Elliot <peada@free.fr>
* Parsetree: add a comment with an example for module_substitutionAaron L. Zeng2021-12-061-0/+1
|
* Fix a typo in parsetree.mliFlorian Angeletti2021-08-191-1/+1
|
* Allow explicit binders for type variables (#10437)Stephen Dolan2021-06-301-4/+8
|
* review: rename Pwith_module_type* to Pwith_modtype*octachron2021-02-251-2/+2
|
* with module type = sig endoctachron2021-02-171-3/+3
| | | | Allow non-path right-hand side for module type with constraints.
* module type S := ...: coreoctachron2021-02-171-0/+2
|
* Module type substitutions: coreoctachron2021-02-171-0/+4
|
* Allow to name existentials in pattern-matching (#9584)Jacques Garrigue2021-02-041-4/+6
|
* re-do of print polyvariants that start with a core_type,closed, not low with ↵Chet Murthy2020-09-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | leading bar ("|"). a type "[ | w ]" must be printed with the "|", or it won't be reparseable. with tests, Changes entry. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch pr-polyvariant-pprint # Changes to be committed: # modified: Changes # modified: parsing/parsetree.mli # modified: parsing/pprintast.ml # modified: testsuite/tests/parsetree/source.ml # # Untracked files: # Changes.orig # parsing/pprintast.ml.orig # testsuite/tests/parsetree/source.ml.orig # testsuite/tests/parsetree/source.ml.rej #
* Add injectivity annotations (#9500)Jacques Garrigue2020-06-151-3/+3
|
* Annotate constant literals with the location of their content.Drup2019-11-131-1/+3
|
* a better representation for modules with no name (#8908)Thomas Refis2019-10-091-7/+16
|
* Add a type alias for location stack in the parsetree (#8803)hhugo2019-07-121-3/+5
|
* Tweak the definition of Parsetree.Pexp_letop (#8535)Xavier Clerc2019-03-211-6/+9
| | | Avoid the use of inline records so that we can keep compatibility with 4.02 in ocaml-migrate-parsetree.
* Add support for "let" operatorsLeo White2018-11-271-0/+15
|
* Extend `open` to arbritrary module expressions in structures and toRunhang Li2018-11-261-6/+15
| | | | applicative module paths in signatures
* introduce local substitutions in signaturesThomas Refis2018-11-091-2/+15
| | | | | type [params] id := type_expr { and [params] id := type_expr } module Uid := extended-module-path
* manual: compiler-libs.mld -> compiler_libs.mldFlorian Angeletti2018-09-121-1/+1
|
* MPR7546, manual: preambles and warnings for compiler-libs modules (#2020)Florian Angeletti2018-09-121-1/+6
| | | | | | * preambles for compiler-libs modules * Compilerlibs intro and warning link
* The parser keeps previous location when relocating ast nodeHugo Heuzard2018-09-061-0/+3
|
* parsetree.{row,object}_field: move attributes in the wrapper recordGabriel Scherer2018-08-201-3/+5
| | | | | | The concrete syntax only allows attributes on tags/constructors/fields (Rtag, Otag), not on inherited subtypes (Rinherit, Oinherit); we add this as new enforced invariant in ast_invariants.
* parsetree: make sure that all nodes that store attributes also store a locationGabriel Scherer2018-08-201-5/+15
| | | | | | | | | | | | | | | | | Florian Angeletti and myself ran into a problem when trying to use attributes for ellision of parts of manual example. We wanted to be turn any ast-node marked with the [@ellipsis] attribute into "..." in the rendering of the corresponding code block, but for this we need the location of the attributed node, and it turns out that some constructions supported attributes without carrying a location: - Rtag in row_field - Otag in object_field - type_exception record - type_extension record We added locations in all those positions, guaranteeing the invariant that all nodes to which attributes can be attached have a precise position.
* Add locations to attributesHugo Heuzard2018-08-061-1/+5
| | | | | | Changes fix typo
* Add locations to toplevel directivesHugo Heuzard2018-08-061-2/+14
|
* allow to attach @@ attributes on exceptionsHugo Heuzard2018-04-091-3/+10
|
* Support empty variants (#1546)objmagic2018-03-061-1/+0
| | | | * Allow empty variants. * Update manual and ocamldoc.
* PR#7363: start documentation headers at {1octachron2017-10-041-5/+5
|
* Merge pull request #792 from sliquister/generalize-destr-subst2Leo White2017-09-151-4/+4
|\ | | | | Fixing the limitations on destructive substitutions
| * Support syntax: S with module M.N := ..Valentin Gatien-Baron2017-08-011-2/+2
| |
| * Support syntax: S with M.N.t := ...Valentin Gatien-Baron2017-08-011-2/+2
| |
* | Fix doc.alainfrisch2017-09-121-3/+3
| |
* | Typos and basic grammar error fixing (#1280)Fourchaux2017-08-101-1/+1
| |
* | parsetree.mli: consistently use 'label' for polymorphic variants and objectsGabriel Scherer2017-07-281-9/+9
| | | | | | | | | | | | | | | | | | PR #1118 had turned polymorphic variant constructors from 'label' to its definition 'string' for consistency with field names in object types; instead, we consistently name 'label' the method and instance variable names throughout the AST. This does not break compatibility as the two types are synonym, but it should improve readability of parsing/parsetree.mli.
* | merge trunk and update testRunhang Li2017-07-231-1/+6
|\ \ | |/
| * Support 'let open' in class and class type expressions (#1249)Alain Frisch2017-07-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support 'let open' in class and class type expressions. * Adapt ocamlprof. * Adapt ocamldoc. * Add tests. * Changelog. * Manual.
* | Support inherited field in object type expression.Mark Li2017-03-221-2/+6
|/ | | | Also add location on object field label and polymorphic variant tags.
* Add missing locations in the parsetree (#749)Fabrice Le Fessant2016-08-291-7/+7
| | | They are not propagated to the typedtree yet.
* document Ppat_open (missing from GPR #187)Gabriel Scherer2016-08-031-3/+4
|
* GPR#187: local open for patternsoctachron2016-05-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | This commits extends the pattern syntax to support local open in patterns. Four new constructions mirroring the expression constructions are added * `M.(pattern)` * `M.[pattern_list]` ⟺ M.([pattern_list]) * `M.{labeled_pattern_list}` ⟺ M.({label_pattern_list}) * `M.[| .. |] ⟺ M.( [| .. |] ) At the typing phase, the construction `M.(pattern)` brings all identifiers defined within M inside the scope and then proceed with the typing of `pattern`. All others constructions are desugared to the `M.(..)` construction during parsing. Questionable implementation details: * Currently, the local pattern open use the `type_open` function like the local expression pattern. However, this implies that values defined inside `M` are also brought to the scope. A specialized `type_open_for_pattern` would be more efficient.
* Local let exceptions.alainfrisch2016-03-151-0/+2
|
* Update headers for the new license.Damien Doligez2016-02-181-11/+14
| | | | Remains to be done: remove all headers in testsuite/tests.
* Rename parsetree constants.Drup2016-01-181-4/+4
| | | | | PConst -> Pconst int -> integer
* Add comments on Parsetree's constants.Drup2016-01-181-0/+14
|
* Add signature payloads for extension and attributes.Drup2015-12-091-0/+1
|
* Parse arbitrary precision integers ..Hugo Heuzard2015-12-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. 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
* switch to 'pat -> .' and add P/Texp_unreachablegadt-warningsJacques Garrigue2015-10-161-1/+3
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
* add refuted cases, syntax is 'pat -> _'Jacques Garrigue2015-10-151-1/+1
| | | | git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02