Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
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).