Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/validation.rs')
-rw-r--r--crates/syntax/src/validation.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs
index 69dffbf79f..5c5b26f525 100644
--- a/crates/syntax/src/validation.rs
+++ b/crates/syntax/src/validation.rs
@@ -5,7 +5,7 @@
mod block;
use rowan::Direction;
-use rustc_lexer::unescape::{self, unescape_literal, Mode};
+use rustc_lexer::unescape::{self, unescape_mixed, unescape_unicode, Mode};
use crate::{
algo,
@@ -140,7 +140,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
ast::LiteralKind::String(s) => {
if !s.is_raw() {
if let Some(without_quotes) = unquote(text, 1, '"') {
- unescape_literal(without_quotes, Mode::Str, &mut |range, char| {
+ unescape_unicode(without_quotes, Mode::Str, &mut |range, char| {
if let Err(err) = char {
push_err(1, range.start, err);
}
@@ -151,7 +151,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
ast::LiteralKind::ByteString(s) => {
if !s.is_raw() {
if let Some(without_quotes) = unquote(text, 2, '"') {
- unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
+ unescape_unicode(without_quotes, Mode::ByteStr, &mut |range, char| {
if let Err(err) = char {
push_err(1, range.start, err);
}
@@ -162,7 +162,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
ast::LiteralKind::CString(s) => {
if !s.is_raw() {
if let Some(without_quotes) = unquote(text, 2, '"') {
- unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
+ unescape_mixed(without_quotes, Mode::CStr, &mut |range, char| {
if let Err(err) = char {
push_err(1, range.start, err);
}
@@ -172,7 +172,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
}
ast::LiteralKind::Char(_) => {
if let Some(without_quotes) = unquote(text, 1, '\'') {
- unescape_literal(without_quotes, Mode::Char, &mut |range, char| {
+ unescape_unicode(without_quotes, Mode::Char, &mut |range, char| {
if let Err(err) = char {
push_err(1, range.start, err);
}
@@ -181,7 +181,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
}
ast::LiteralKind::Byte(_) => {
if let Some(without_quotes) = unquote(text, 2, '\'') {
- unescape_literal(without_quotes, Mode::Byte, &mut |range, char| {
+ unescape_unicode(without_quotes, Mode::Byte, &mut |range, char| {
if let Err(err) = char {
push_err(2, range.start, err);
}