File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -457,7 +457,8 @@ where
457457 break ;
458458 }
459459 }
460- u8:: from_str_radix ( & octet_content, 8 ) . unwrap ( ) as char
460+ let value = u32:: from_str_radix ( & octet_content, 8 ) . unwrap ( ) ;
461+ char:: from_u32 ( value) . unwrap ( )
461462 }
462463
463464 fn parse_unicode_name ( & mut self ) -> Result < char , LexicalError > {
@@ -1596,7 +1597,7 @@ mod tests {
15961597
15971598 #[ test]
15981599 fn test_string ( ) {
1599- let source = r#""double" 'single' 'can\'t' "\\\"" '\t\r\n' '\g' r'raw\'' '\200\0a'"# ;
1600+ let source = r#""double" 'single' 'can\'t' "\\\"" '\t\r\n' '\g' r'raw\'' '\420' '\ 200\0a'"# ;
16001601 let tokens = lex_source ( source) ;
16011602 assert_eq ! (
16021603 tokens,
@@ -1629,6 +1630,10 @@ mod tests {
16291630 value: String :: from( "raw\\ '" ) ,
16301631 is_fstring: false ,
16311632 } ,
1633+ Tok :: String {
1634+ value: String :: from( "Đ" ) ,
1635+ is_fstring: false ,
1636+ } ,
16321637 Tok :: String {
16331638 value: String :: from( "\u{80} \u{0} a" ) ,
16341639 is_fstring: false ,
You can’t perform that action at this time.
0 commit comments