* Improve the formatting of sub-errors in error/warning reports
This avoids indenting sub-errors on the right of "Error:" (or "Warning x:"), and
implements more compact printing (the sub-location message is printed on the same
line of the location if it can fit).
* Extend the formatting test demonstrating report printing
Menhir has two keywords to describe "the current source position",
$loc and $sloc. $sloc is more precise (it is included within $loc),
and the two differ only when the production starts with empty symbols,
and the difference only spans over whitespace.
We originally used $loc by default to emulate ocamlyacc behavior,
but $sloc is generally preferable, so this PR converts all locations
to use $sloc.
(Note: the location-of-a-symbol keyword remains $loc(...), for example
$loc($1) or $loc(foo), there is no $sloc version of those.)
[core_type_comma_list] with [core_type], as this is what is really intended:
allow a single type. This removes the need for raising [Parsing.Parse_error]
in the semantic action, and should fix bug #7847. This change alone would
create a conflict in the grammar, which is avoided by replacing
[core_type_comma_list] with [inline_core_type_comma_list] in two places.
and use it to give a more concise definition of [core_type_comma_list]. This
should make no difference whatsoever: the generated LALR(1) automaton should
be the same (up to some possible differences in naming).
The large diff in boot/menhir/parser_menhir.ml comes from the fact
that the token list is now included in it, instead of being merely
a reference to the yacc parsers' Parser.token type.
This reverts commit f0b7535d228c47b4343ab6268c760db9c4912b57.
Those changes to the ocamlyacc parser helped during the yacc->menhir
transition, as they allowed to make the semantic action code
indentical between the yacc and menhir parser, which makes rebasing
against new yacc-parser versions much easier.
Instead of removing the change from the history, we revert it
explicitly so that we can easiy come back later to the non-reverted
version for testing or rebasing.