Skip to content

Cut out a bunch of Result and panictry! boilerplate from libsyntax. #30654

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

Merged
merged 1 commit into from
Jan 6, 2016

Conversation

nrc
Copy link
Member

@nrc nrc commented Dec 31, 2015

The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery.

[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!

[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
@rust-highfive
Copy link
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@brson
Copy link
Contributor

brson commented Jan 5, 2016

The two test case changes look like regressions. Why are they ok?

@brson
Copy link
Contributor

brson commented Jan 5, 2016

What's the path forward here? It looks like panictry is intended to be the way to convert the parser to not panic by ultimately converting panictry to try.

@nrc
Copy link
Member Author

nrc commented Jan 5, 2016

The path forward is that the parser works like the rest of the compiler and emits errors as it goes along, if it panics it does so only at the end of parsing. We do our best to recover from errors at as low a level as possible and pass up errors only when we can't recover from them.

@@ -14,6 +14,7 @@

fn foo(p: proc()) { } //~ ERROR `proc` is a reserved keyword

fn bar() { proc() 1; }
fn bar() { proc() 1; } //~ ERROR `proc` is a reserved keyword
//~^ ERROR expected

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this test we get a more informative error message because we are panicking a little bit later

@nrc
Copy link
Member Author

nrc commented Jan 6, 2016

r? @brson

@rust-highfive rust-highfive assigned brson and unassigned alexcrichton Jan 6, 2016
@brson
Copy link
Contributor

brson commented Jan 6, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 6, 2016

📌 Commit 9023c65 has been approved by brson

bors added a commit that referenced this pull request Jan 6, 2016
The motivation (other than removing boilerplate) is that this is a baby step towards a parser with error recovery.

[breaking-change] if you use any of the changed functions, you'll need to remove a try! or panictry!
@bors
Copy link
Collaborator

bors commented Jan 6, 2016

⌛ Testing commit 9023c65 with merge 5daa753...

@bors bors merged commit 9023c65 into rust-lang:master Jan 6, 2016
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.

5 participants