Require end-of-input to be reached for range-based parser invocations #808
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation: We use a custom-made parser-combinator framework for high-performance parsers in VAST, and to combine parsers one needs to be able to resume parsing after partial consumption of input. Experience has shown (e.g., #791) that we don't usually want to silently discard input on the resulting, combined parsers.
Before the change implemented by this PR, EOI checks were required to be done manually by the caller, e.g. by calling
(p >> eoi)(rng, attr)
overp(rng, attr)
. Outside of combining with theeoi
parser, there was no way to verify whether the EOI was reached successfully for range-based parser invocations. This has turned out to be very error prone.For
[begin, end)
-iterator based invocations, nothing changes. It is easy for the caller to verify whether the EOI was reached successfully by simply comparingbegin
andend
.Among other things, this PR completely disables the MRT integration, which we knew to be broken, but which silently succeeded in parsing invalid data. It will be revisited at a later point in time.