Update to pratter 5
From pratter 4, it's possible to interpret a single token in different ways. This allows for instance to consider the symbol - as both the unary and binary minus.
Is the bumping of the minimal OCaml version really required here? Perhaps this is now not necessary anymore after our monad omission ...? :)
I'm afraid the version 4.14 is required by the operation Seq.uncons, monads aren't guilty there
I guess you could then very easily replace Seq.uncons by something equivalent in Pratter. It's currently used only here:
let tok : ('tok, 'tok option) parser =
fun inp ->
match Seq.uncons inp with
| None -> Ok (None, Seq.empty)
| Some (t, rest) -> Ok (Some t, rest)
Unfolding Seq.uncons, this could easily be something like (modulo importing Nil and Cons):
let tok : ('tok, 'tok option) parser =
fun inp ->
match inp () with
| Nil -> Ok (None, Seq.empty)
| Cons (t, rest) -> Ok (Some t, rest)
Not tested, but if uncons is the only reason for bumping the MSOV (minimal supported OCaml version), it might be worth to reconsider that. ;)
Hi @gabrielhdt . Michael's suggestion looks nice and easy to implement. Do you want to try it? I will then wait for the version 5.1 of pratter and an update of this PR.
Looks good to me ! I'll give it a shot.
FYI I've managed to reduced the minimal supported ocaml version to 4.10.
On the question of whether this version is low enough or not, I tend to think that if a program is compatible with Debian stable, it's ok.
Now I just have to publish all that to opam :)
Hi @gabrielhdt . I see that pratter 5.0.1 is now available on opam. Could you please update your PR so that I can merge it?