type t += A = M.A [@a]
was pretty-printed as
type t += A[@a] = M.A
[obviously wrong, also not accepted by parser]
With tests for extension-constructors and exceptions.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-extension-constructor-rebind-pprint-4.11
# Changes to be committed:
# modified: Changes
# 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
#
# 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
# Your branch is up to date with 'my-fork/pr-polyvariant-pprint'.
#
# Changes to be committed:
# modified: Changes
#
# Untracked files:
# Changes.orig
# parsing/pprintast.ml.orig
# testsuite/tests/parsetree/source.ml.orig
# testsuite/tests/parsetree/source.ml.rej
#
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
#
`List.equal f foo bar` is nicer than
`List.length foo = List.length bar && List.for_all2 f foo bar`.
Note: with List.compare there is a risk of users having opened the
List module, and then using 'compare' from the stdlib unqualified. For
example:
List.(sort compare foo bar)
Such code will break (type error), and has to be fixed by using
Stdlib.compare. Stdlib is available since OCaml 4.07; people wishing
to support both 4.12 and older releases would have to avoid opening
List, or rebind 'compare' locally.
* Allow running a single test in testsuite/Makefile. Syntax is `make one FILE=...`
* Rename `make list` into `make one LIST=...` for consistency.
* Always read actual lines from files
read should, as a general rule, always be followed by -r in scripts. If
IFS is not empty, then spaces are stripped as well.