| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Add an explicit type constraint field to the Parsetree node for value bindings (`let p : typ = exp`).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
* Odocify the parsetree comments
Signed-off-by: Paul-Elliot <peada@free.fr>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Allow non-path right-hand side for module type with constraints.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
#
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Avoid the use of inline records so that we can keep compatibility with 4.02 in ocaml-migrate-parsetree.
|
| |
|
|
|
|
| |
applicative module paths in signatures
|
|
|
|
|
| |
type [params] id := type_expr { and [params] id := type_expr }
module Uid := extended-module-path
|
| |
|
|
|
|
|
|
| |
* preambles for compiler-libs modules
* Compilerlibs intro and warning link
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Changes
fix typo
|
| |
|
| |
|
|
|
|
| |
* Allow empty variants.
* Update manual and ocamldoc.
|
| |
|
|\
| |
| | |
Fixing the limitations on destructive substitutions
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Support 'let open' in class and class type expressions.
* Adapt ocamlprof.
* Adapt ocamldoc.
* Add tests.
* Changelog.
* Manual.
|
|/
|
|
| |
Also add location on object field label and polymorphic variant tags.
|
|
|
| |
They are not propagated to the typedtree yet.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Remains to be done: remove all headers in testsuite/tests.
|
|
|
|
|
| |
PConst -> Pconst
int -> integer
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
.. 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
|
|
|
|
| |
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16507 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
|
|
|
|
| |
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/gadt-warnings@16500 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
|