commits
Remove the GNU Make build system in favour of Dune
opam file: constraint ocaml to 3.09.0 as we use `ksprintf`
change kprintf -> ksprintf
Fix running tests for bytecode-only
Signed-off-by: Ali Caglayan <alizter@gmail.com>
<!-- ps-id: 229f4f86-516a-4df0-87c5-cf36e72a4e39 -->
Hygiene tests: don't duplicate compilation units
Minor post-release improvements
Fix extra line added after non empty header
Parsing future opam files take 2
opam-version with a value greater than 2.1 always comes first.
Completely reimplements the best-effort parsing mode. The previous
attempt failed if a lexing or parsing error occured before the
opam-version item had been fully parsed.
This revised version begins by reading three tokens from the lexer
directly to parse the opam-version, if it's present. It _then_ calls the
ocamlyacc parser (feeding the three tokens back to it).
If the opam-version parsed is greater than the library's internal
version, then _any_ exception causes just the parsed opam-version header
to be returned (which is sufficient for the client to display that the
file is newer than itself).
Finally, in order to permit, for example, opam 2.2 to have new fields
but no new lexer or parser, exceptions cause both the opam-version
variable to be returned and also a sentinel group with kind `#` which
can be used by the client to determine that a parsing/lexing error
occurred (and where).
Require opam-version 2.1 and greater at the start of the file
Position the lexbuf's markers to point to the offending opam-version
line if a Parse_error is raised.
It should be the case that the EOF token generated by the lexer on error
will immediately unravel the parser, however there's a tiny chance that
error recovery might cause the lexer to attempt reading some more
tokens. Therefore we store the position of the lexbuf and restore it
before the exception is raised.
Fix the Makefile-based build system (again)
Completely reimplements the best-effort parsing mode. The previous
attempt failed if a lexing or parsing error occured before the
opam-version item had been fully parsed.
This revised version begins by reading three tokens from the lexer
directly to parse the opam-version, if it's present. It _then_ calls the
ocamlyacc parser (feeding the three tokens back to it).
If the opam-version parsed is greater than the library's internal
version, then _any_ exception causes just the parsed opam-version header
to be returned (which is sufficient for the client to display that the
file is newer than itself).
Finally, in order to permit, for example, opam 2.2 to have new fields
but no new lexer or parser, exceptions cause both the opam-version
variable to be returned and also a sentinel group with kind `#` which
can be used by the client to determine that a parsing/lexing error
occurred (and where).
It should be the case that the EOF token generated by the lexer on error
will immediately unravel the parser, however there's a tiny chance that
error recovery might cause the lexer to attempt reading some more
tokens. Therefore we store the position of the lexbuf and restore it
before the exception is raised.