From 4788c7a0569107372d78e1a1619a644ae5ac72bc Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 8 Feb 2023 11:39:20 +0100 Subject: [PATCH] Bump `rustc-ap-rustc_lexer` --- Cargo.lock | 4 ++-- crates/parser/Cargo.toml | 2 +- crates/parser/src/lexed_str.rs | 5 +++++ crates/syntax/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9cc34a876dc..ef0316f30fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1494,9 +1494,9 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_lexer" -version = "725.0.0" +version = "727.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950742ef8a203aa7661aad3ab880438ddeb7f95d4b837c30d65db1a2c5df68e" +checksum = "8f40f26e7abdcd3b982f36c09a634cc6187988fbf6ec466c91f8d30a12ac0237" dependencies = [ "unicode-xid", ] diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index ab48b1392a9..08359133f1a 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -13,7 +13,7 @@ doctest = false [dependencies] drop_bomb = "0.1.5" -rustc_lexer = { version = "725.0.0", package = "rustc-ap-rustc_lexer" } +rustc_lexer = { version = "727.0.0", package = "rustc-ap-rustc_lexer" } limit.workspace = true diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs index b48921f1917..100deff462d 100644 --- a/crates/parser/src/lexed_str.rs +++ b/crates/parser/src/lexed_str.rs @@ -82,6 +82,7 @@ pub fn kind(&self, i: usize) -> SyntaxKind { pub fn text(&self, i: usize) -> &str { self.range_text(i..i + 1) } + pub fn range_text(&self, r: ops::Range) -> &str { assert!(r.start < r.end && r.end <= self.len()); let lo = self.start[r.start] as usize; @@ -216,6 +217,10 @@ fn extend_token(&mut self, kind: &rustc_lexer::TokenKind, token_text: &str) { rustc_lexer::TokenKind::Caret => T![^], rustc_lexer::TokenKind::Percent => T![%], rustc_lexer::TokenKind::Unknown => ERROR, + rustc_lexer::TokenKind::UnknownPrefix => { + err = "unknown literal prefix"; + IDENT + } } }; diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 1a845a6ee71..8fc493a23f5 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -16,7 +16,7 @@ doctest = false cov-mark = "2.0.0-pre.1" itertools = "0.10.5" rowan = "0.15.10" -rustc_lexer = { version = "725.0.0", package = "rustc-ap-rustc_lexer" } +rustc_lexer = { version = "727.0.0", package = "rustc-ap-rustc_lexer" } rustc-hash = "1.1.0" once_cell = "1.17.0" indexmap = "1.9.1"