-
Notifications
You must be signed in to change notification settings - Fork 36
Update to pratter 5 #1196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update to pratter 5 #1196
Conversation
Remove list monad
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 |
I guess you could then very easily replace 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 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 |
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 :) |
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.