Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Use parse_seq_to_before_end to keep the end token. #171

Merged
merged 1 commit into from
Apr 1, 2016

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Mar 28, 2016

Without this change parse_seq_to_end eats the EOF so expect(Eof) ICEs under rust-lang/rust#32479.

bors added a commit to rust-lang/rust that referenced this pull request Mar 29, 2016
Prevent bumping the parser past the EOF.

Makes `Parser::bump` after EOF into an ICE, forcing callers to avoid repeated EOF bumps.
This ICE is intended to break infinite loops where EOF wasn't stopping the loop.

For example, the handling of EOF in `parse_trait_items`' recovery loop fixes #32446.
But even without this specific fix, the ICE is triggered, which helps diagnosis and UX.

This is a `[breaking-change]` for plugins authors who eagerly eat multiple EOFs.
See docopt/docopt.rs#171 for such an example and the necessary fix.
@BurntSushi
Copy link
Member

@eddyb I kicked off Travis again. It looks like this is still causing an ICE?

@BurntSushi BurntSushi merged commit 7248689 into docopt:master Apr 1, 2016
@eddyb eddyb deleted the patch-1 branch April 1, 2016 21:18
@BurntSushi
Copy link
Member

Got it, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants