55mod block;
66
77use rowan:: Direction ;
8- use rustc_lexer:: unescape:: { self , unescape_c_string , unescape_literal , Mode } ;
8+ use rustc_lexer:: unescape:: { self , unescape_mixed , unescape_unicode , Mode } ;
99
1010use crate :: {
1111 algo,
@@ -140,7 +140,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
140140 ast:: LiteralKind :: String ( s) => {
141141 if !s. is_raw ( ) {
142142 if let Some ( without_quotes) = unquote ( text, 1 , '"' ) {
143- unescape_literal ( without_quotes, Mode :: Str , & mut |range, char| {
143+ unescape_unicode ( without_quotes, Mode :: Str , & mut |range, char| {
144144 if let Err ( err) = char {
145145 push_err ( 1 , range. start , err) ;
146146 }
@@ -151,7 +151,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
151151 ast:: LiteralKind :: ByteString ( s) => {
152152 if !s. is_raw ( ) {
153153 if let Some ( without_quotes) = unquote ( text, 2 , '"' ) {
154- unescape_literal ( without_quotes, Mode :: ByteStr , & mut |range, char| {
154+ unescape_unicode ( without_quotes, Mode :: ByteStr , & mut |range, char| {
155155 if let Err ( err) = char {
156156 push_err ( 1 , range. start , err) ;
157157 }
@@ -162,7 +162,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
162162 ast:: LiteralKind :: CString ( s) => {
163163 if !s. is_raw ( ) {
164164 if let Some ( without_quotes) = unquote ( text, 2 , '"' ) {
165- unescape_c_string ( without_quotes, Mode :: CStr , & mut |range, char| {
165+ unescape_mixed ( without_quotes, Mode :: CStr , & mut |range, char| {
166166 if let Err ( err) = char {
167167 push_err ( 1 , range. start , err) ;
168168 }
@@ -172,7 +172,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
172172 }
173173 ast:: LiteralKind :: Char ( _) => {
174174 if let Some ( without_quotes) = unquote ( text, 1 , '\'' ) {
175- unescape_literal ( without_quotes, Mode :: Char , & mut |range, char| {
175+ unescape_unicode ( without_quotes, Mode :: Char , & mut |range, char| {
176176 if let Err ( err) = char {
177177 push_err ( 1 , range. start , err) ;
178178 }
@@ -181,7 +181,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
181181 }
182182 ast:: LiteralKind :: Byte ( _) => {
183183 if let Some ( without_quotes) = unquote ( text, 2 , '\'' ) {
184- unescape_literal ( without_quotes, Mode :: Byte , & mut |range, char| {
184+ unescape_unicode ( without_quotes, Mode :: Byte , & mut |range, char| {
185185 if let Err ( err) = char {
186186 push_err ( 2 , range. start , err) ;
187187 }
0 commit comments