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: Handle \r\n in byte string literals #16282

Merged
merged 1 commit into from
Aug 6, 2014

Conversation

alexcrichton
Copy link
Member

This ended up passing through the lexer but dying later on in parsing when it
wasn't handled. The strategy taken was to copy the str_lit funciton, but adapt
it for bytes.

Closes #16278

@lilyball
Copy link
Contributor

lilyball commented Aug 5, 2014

str_lit also handles a \r that's not backslash-prefixed. I don't see that in binary_lit. How does it behave if you embed a raw \r or a \r\n sequence in a byte string literal?

@alexcrichton
Copy link
Member Author

Added a clause for that and updated the test as well.

}
eat(&mut chars);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be perhaps a bit cleaner if this if-elseif-else is made into a match.

@lilyball
Copy link
Contributor

lilyball commented Aug 5, 2014

r=me with comments addressed.

This ended up passing through the lexer but dying later on in parsing when it
wasn't handled. The strategy taken was to copy the `str_lit` funciton, but adapt
it for bytes.

Closes rust-lang#16278
@bors bors merged commit 74ae05a into rust-lang:master Aug 6, 2014
@alexcrichton alexcrichton deleted the issue-16728 branch August 6, 2014 21:26
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.

ICE: indexes do not lie on character boundaries with byte literal and \r\n
3 participants