5
5
mod block;
6
6
7
7
use 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 } ;
9
9
10
10
use crate :: {
11
11
algo,
@@ -140,7 +140,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
140
140
ast:: LiteralKind :: String ( s) => {
141
141
if !s. is_raw ( ) {
142
142
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| {
144
144
if let Err ( err) = char {
145
145
push_err ( 1 , range. start , err) ;
146
146
}
@@ -151,7 +151,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
151
151
ast:: LiteralKind :: ByteString ( s) => {
152
152
if !s. is_raw ( ) {
153
153
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| {
155
155
if let Err ( err) = char {
156
156
push_err ( 1 , range. start , err) ;
157
157
}
@@ -162,7 +162,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
162
162
ast:: LiteralKind :: CString ( s) => {
163
163
if !s. is_raw ( ) {
164
164
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| {
166
166
if let Err ( err) = char {
167
167
push_err ( 1 , range. start , err) ;
168
168
}
@@ -172,7 +172,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
172
172
}
173
173
ast:: LiteralKind :: Char ( _) => {
174
174
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| {
176
176
if let Err ( err) = char {
177
177
push_err ( 1 , range. start , err) ;
178
178
}
@@ -181,7 +181,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
181
181
}
182
182
ast:: LiteralKind :: Byte ( _) => {
183
183
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| {
185
185
if let Err ( err) = char {
186
186
push_err ( 2 , range. start , err) ;
187
187
}
0 commit comments