Skip to content

Commit

Permalink
Rollup merge of rust-lang#103919 - nnethercote:unescaping-cleanups, r…
Browse files Browse the repository at this point in the history
…=matklad

Unescaping cleanups

Some code improvements, and some error message improvements.

Best reviewed one commit at a time.

r? ````@matklad````
  • Loading branch information
Dylan-DPC authored Nov 9, 2022
2 parents c60b1f6 + 7d2a1ee commit a65ca91
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/syntax/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
mod block;

use rowan::Direction;
use rustc_lexer::unescape::{
self, unescape_byte, unescape_byte_literal, unescape_char, unescape_literal, Mode,
};
use rustc_lexer::unescape::{self, unescape_byte, unescape_char, unescape_literal, Mode};

use crate::{
algo,
Expand Down Expand Up @@ -143,7 +141,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_byte_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
if let Err(err) = char {
push_err(2, (range.start, err));
}
Expand Down

0 comments on commit a65ca91

Please sign in to comment.