Bump rustc-ap-rustc_lexer

This commit is contained in:
Lukas Wirth 2023-02-08 11:39:20 +01:00
parent f03fb262f7
commit 4788c7a056
4 changed files with 9 additions and 4 deletions

4
Cargo.lock generated
View File

@ -1494,9 +1494,9 @@ dependencies = [
[[package]] [[package]]
name = "rustc-ap-rustc_lexer" name = "rustc-ap-rustc_lexer"
version = "725.0.0" version = "727.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f950742ef8a203aa7661aad3ab880438ddeb7f95d4b837c30d65db1a2c5df68e" checksum = "8f40f26e7abdcd3b982f36c09a634cc6187988fbf6ec466c91f8d30a12ac0237"
dependencies = [ dependencies = [
"unicode-xid", "unicode-xid",
] ]

View File

@ -13,7 +13,7 @@ doctest = false
[dependencies] [dependencies]
drop_bomb = "0.1.5" 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 limit.workspace = true

View File

@ -82,6 +82,7 @@ pub fn kind(&self, i: usize) -> SyntaxKind {
pub fn text(&self, i: usize) -> &str { pub fn text(&self, i: usize) -> &str {
self.range_text(i..i + 1) self.range_text(i..i + 1)
} }
pub fn range_text(&self, r: ops::Range<usize>) -> &str { pub fn range_text(&self, r: ops::Range<usize>) -> &str {
assert!(r.start < r.end && r.end <= self.len()); assert!(r.start < r.end && r.end <= self.len());
let lo = self.start[r.start] as usize; 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::Caret => T![^],
rustc_lexer::TokenKind::Percent => T![%], rustc_lexer::TokenKind::Percent => T![%],
rustc_lexer::TokenKind::Unknown => ERROR, rustc_lexer::TokenKind::Unknown => ERROR,
rustc_lexer::TokenKind::UnknownPrefix => {
err = "unknown literal prefix";
IDENT
}
} }
}; };

View File

@ -16,7 +16,7 @@ doctest = false
cov-mark = "2.0.0-pre.1" cov-mark = "2.0.0-pre.1"
itertools = "0.10.5" itertools = "0.10.5"
rowan = "0.15.10" 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" rustc-hash = "1.1.0"
once_cell = "1.17.0" once_cell = "1.17.0"
indexmap = "1.9.1" indexmap = "1.9.1"