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

syntax: Display spans for open delimiters when a file ends prematurely #9756

Closed
wants to merge 2 commits into from

Conversation

catamorphism
Copy link
Contributor

r? anybody It's more helpful to list the span of each open delimiter seen so far
than to print out an error with the span of the last position in the file.

Closes #2354

It's more helpful to list the span of each open delimiter seen so far
than to print out an error with the span of the last position in the file.

Closes rust-lang#2354
@@ -336,6 +337,8 @@ pub struct Parser {
obsolete_set: @mut HashSet<ObsoleteSyntax>,
/// Used to determine the path to externally loaded source files
mod_path_stack: @mut ~[@str],
/// Stack of spans of open delimiters. Used for error message.
open_braces: @mut ~[@Span]
Copy link
Member

Choose a reason for hiding this comment

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

Is @Span necessary? I thought Span was implicitly copyable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it? Hmm, I'll check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right!

@alexcrichton
Copy link
Member

r=me if @Span is necessary
r=me if @Span changes to Span
r=me on anything else because this has bit me so many times.

bors added a commit that referenced this pull request Oct 8, 2013
r? anybody It's more helpful to list the span of each open delimiter seen so far
than to print out an error with the span of the last position in the file.

Closes #2354
@bors bors closed this Oct 8, 2013
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.

Bad parse error message for missing alt close brace
4 participants