Skip to content
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

consume: Add required consume argument to parse functions #196

Merged
merged 2 commits into from
Apr 19, 2020
Merged

Conversation

seliopou
Copy link
Member

@seliopou seliopou commented Apr 19, 2020

For oneshot parse functions, require that the caller specify whether the parser should consume all of the provided input or just a prefix.

Most parsers are written so that they can consume the prefix of a string. This combined with the use of backtracking can cause unexpected parse results where only part of the input was consumed. This is one of many reasons to avoid backtracking.

In any case, making the behavior explicit in the call will hopefully demistify some of these results.

For oneshot parse functions, require that the caller specify whether the
parser should consume all of the provided input or just a prefix.

Most parsers are written so that they can consume the prefix of a
string. This combined with the use of backtracking can cause unexpected
parse results where only part of the input was consumed. This is one of
many reasons to avoid backtracking.

In any case, making the behavior explicit in the call will hopefully
demistify some of these results.
@seliopou
Copy link
Member Author

Closes #183.

@seliopou seliopou changed the title consume: Add require consume argument to parse functions consume: Add requirer consume argument to parse functions Apr 19, 2020
@seliopou seliopou changed the title consume: Add requirer consume argument to parse functions consume: Add required consume argument to parse functions Apr 19, 2020
@seliopou
Copy link
Member Author

The build is failing on OCaml 4.05.0 due to a timeout when running the following command:

+ opam install --with-test angstrom-async angstrom-lwt-unix

<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[angstrom-async.0.13.0] no changes from file:///repo
[angstrom-lwt-unix.0.13.0] no changes from file:///repo

[ERROR] Sorry, resolution of the request timed out.
        Try to specify a simpler request, use a different solver, or increase the allowed time by setting OPAMSOLVERTIMEOUT to a bigger value (currently, it is set to 60.0 seconds).
'unset TESTS; OPAMYES=1 export OPAMYES; set -uex; opam install --with-test angstrom-async angstrom-lwt-unix && opam exec -- make examples' exited 60. Terminating with 60

The command "bash -ex ./.travis-docker.sh" exited with 60.

Done. Your build exited with 1.

The solver keeps timing out trying to come up with a solution when
installing angstrom-async and angstrom-lwt-unix packages. Could not
reporduce locally.
@seliopou seliopou merged commit b0eaecc into master Apr 19, 2020
@seliopou seliopou deleted the consume branch April 19, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant