@@ -400,7 +400,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
400
400
. with_code ( error_code ! ( E0762 ) )
401
401
. emit ( )
402
402
}
403
- self . cook_quoted ( token:: Char , Mode :: Char , start, end, 1 , 1 ) // ' '
403
+ self . cook_unicode ( token:: Char , Mode :: Char , start, end, 1 , 1 ) // ' '
404
404
}
405
405
rustc_lexer:: LiteralKind :: Byte { terminated } => {
406
406
if !terminated {
@@ -412,7 +412,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
412
412
. with_code ( error_code ! ( E0763 ) )
413
413
. emit ( )
414
414
}
415
- self . cook_quoted ( token:: Byte , Mode :: Byte , start, end, 2 , 1 ) // b' '
415
+ self . cook_unicode ( token:: Byte , Mode :: Byte , start, end, 2 , 1 ) // b' '
416
416
}
417
417
rustc_lexer:: LiteralKind :: Str { terminated } => {
418
418
if !terminated {
@@ -424,7 +424,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
424
424
. with_code ( error_code ! ( E0765 ) )
425
425
. emit ( )
426
426
}
427
- self . cook_quoted ( token:: Str , Mode :: Str , start, end, 1 , 1 ) // " "
427
+ self . cook_unicode ( token:: Str , Mode :: Str , start, end, 1 , 1 ) // " "
428
428
}
429
429
rustc_lexer:: LiteralKind :: ByteStr { terminated } => {
430
430
if !terminated {
@@ -436,7 +436,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
436
436
. with_code ( error_code ! ( E0766 ) )
437
437
. emit ( )
438
438
}
439
- self . cook_quoted ( token:: ByteStr , Mode :: ByteStr , start, end, 2 , 1 ) // b" "
439
+ self . cook_unicode ( token:: ByteStr , Mode :: ByteStr , start, end, 2 , 1 ) // b" "
440
440
}
441
441
rustc_lexer:: LiteralKind :: CStr { terminated } => {
442
442
if !terminated {
@@ -448,13 +448,13 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
448
448
. with_code ( error_code ! ( E0767 ) )
449
449
. emit ( )
450
450
}
451
- self . cook_c_string ( token:: CStr , Mode :: CStr , start, end, 2 , 1 ) // c" "
451
+ self . cook_mixed ( token:: CStr , Mode :: CStr , start, end, 2 , 1 ) // c" "
452
452
}
453
453
rustc_lexer:: LiteralKind :: RawStr { n_hashes } => {
454
454
if let Some ( n_hashes) = n_hashes {
455
455
let n = u32:: from ( n_hashes) ;
456
456
let kind = token:: StrRaw ( n_hashes) ;
457
- self . cook_quoted ( kind, Mode :: RawStr , start, end, 2 + n, 1 + n) // r##" "##
457
+ self . cook_unicode ( kind, Mode :: RawStr , start, end, 2 + n, 1 + n) // r##" "##
458
458
} else {
459
459
self . report_raw_str_error ( start, 1 ) ;
460
460
}
@@ -463,7 +463,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
463
463
if let Some ( n_hashes) = n_hashes {
464
464
let n = u32:: from ( n_hashes) ;
465
465
let kind = token:: ByteStrRaw ( n_hashes) ;
466
- self . cook_quoted ( kind, Mode :: RawByteStr , start, end, 3 + n, 1 + n) // br##" "##
466
+ self . cook_unicode ( kind, Mode :: RawByteStr , start, end, 3 + n, 1 + n) // br##" "##
467
467
} else {
468
468
self . report_raw_str_error ( start, 2 ) ;
469
469
}
@@ -472,7 +472,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
472
472
if let Some ( n_hashes) = n_hashes {
473
473
let n = u32:: from ( n_hashes) ;
474
474
let kind = token:: CStrRaw ( n_hashes) ;
475
- self . cook_c_string ( kind, Mode :: RawCStr , start, end, 3 + n, 1 + n) // cr##" "##
475
+ self . cook_mixed ( kind, Mode :: RawCStr , start, end, 3 + n, 1 + n) // cr##" "##
476
476
} else {
477
477
self . report_raw_str_error ( start, 2 ) ;
478
478
}
@@ -735,7 +735,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
735
735
}
736
736
}
737
737
738
- fn cook_quoted (
738
+ fn cook_unicode (
739
739
& self ,
740
740
kind : token:: LitKind ,
741
741
mode : Mode ,
@@ -745,13 +745,13 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
745
745
postfix_len : u32 ,
746
746
) -> ( token:: LitKind , Symbol ) {
747
747
self . cook_common ( kind, mode, start, end, prefix_len, postfix_len, |src, mode, callback| {
748
- unescape:: unescape_literal ( src, mode, & mut |span, result| {
748
+ unescape:: unescape_unicode ( src, mode, & mut |span, result| {
749
749
callback ( span, result. map ( drop) )
750
750
} )
751
751
} )
752
752
}
753
753
754
- fn cook_c_string (
754
+ fn cook_mixed (
755
755
& self ,
756
756
kind : token:: LitKind ,
757
757
mode : Mode ,
@@ -761,7 +761,7 @@ impl<'sess, 'src> StringReader<'sess, 'src> {
761
761
postfix_len : u32 ,
762
762
) -> ( token:: LitKind , Symbol ) {
763
763
self . cook_common ( kind, mode, start, end, prefix_len, postfix_len, |src, mode, callback| {
764
- unescape:: unescape_c_string ( src, mode, & mut |span, result| {
764
+ unescape:: unescape_mixed ( src, mode, & mut |span, result| {
765
765
callback ( span, result. map ( drop) )
766
766
} )
767
767
} )
0 commit comments