Actually translate CRLF in raw byte strings and unify unescape impl

This commit is contained in:
Igor Matuszewski
2019-06-09 14:43:31 +02:00
parent 3c1d352dc4
commit 735ac057bb
3 changed files with 69 additions and 25 deletions

View File

@@ -1348,7 +1348,7 @@ impl<'a> StringReader<'a> {
fn validate_raw_str_escape(&self, content_start: BytePos, content_end: BytePos) {
self.with_str_from_to(content_start, content_end, |lit: &str| {
unescape::unescape_raw_str(lit, unescape::Mode::Str, &mut |range, c| {
unescape::unescape_raw_str(lit, &mut |range, c| {
if let Err(err) = c {
emit_unescape_error(
&self.sess.span_diagnostic,
@@ -1365,7 +1365,7 @@ impl<'a> StringReader<'a> {
fn validate_raw_byte_str_escape(&self, content_start: BytePos, content_end: BytePos) {
self.with_str_from_to(content_start, content_end, |lit: &str| {
unescape::unescape_raw_str(lit, unescape::Mode::ByteStr, &mut |range, c| {
unescape::unescape_raw_byte_str(lit, &mut |range, c| {
if let Err(err) = c {
emit_unescape_error(
&self.sess.span_diagnostic,