diff options
author | Laurențiu Nicola <[email protected]> | 2020-06-27 08:26:28 +0100 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2020-06-27 11:56:54 +0100 |
commit | 52a488982f954978ff183fef976ec7612eca6883 (patch) | |
tree | 80ca0ff4d5fa66dca2a7db2e8865a5eee6e87676 | |
parent | d036006c95cde8844f527109c4a34b7e122c34e8 (diff) |
Bump rustc_lexer
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | crates/ra_syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/parsing/lexer.rs | 24 |
3 files changed, 15 insertions, 15 deletions
diff --git a/Cargo.lock b/Cargo.lock index a7b8a252c..c040bfb95 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -1420,9 +1420,9 @@ dependencies = [ | |||
1420 | 1420 | ||
1421 | [[package]] | 1421 | [[package]] |
1422 | name = "rustc-ap-rustc_lexer" | 1422 | name = "rustc-ap-rustc_lexer" |
1423 | version = "661.0.0" | 1423 | version = "666.0.0" |
1424 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1425 | checksum = "a6d88abd7c634b52557e46fc7ba47644f0cbe45c358c33f51c532d60d1da239e" | 1425 | checksum = "4e00c526f9f8430ea4cd2178d25b02bfc7debe6677350c57292f92f50e65d2fe" |
1426 | dependencies = [ | 1426 | dependencies = [ |
1427 | "unicode-xid", | 1427 | "unicode-xid", |
1428 | ] | 1428 | ] |
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index a8ff2e74f..49696ce75 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml | |||
@@ -13,7 +13,7 @@ doctest = false | |||
13 | [dependencies] | 13 | [dependencies] |
14 | itertools = "0.9.0" | 14 | itertools = "0.9.0" |
15 | rowan = "0.10.0" | 15 | rowan = "0.10.0" |
16 | rustc_lexer = { version = "661.0.0", package = "rustc-ap-rustc_lexer" } | 16 | rustc_lexer = { version = "666.0.0", package = "rustc-ap-rustc_lexer" } |
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
18 | arrayvec = "0.5.1" | 18 | arrayvec = "0.5.1" |
19 | once_cell = "1.3.1" | 19 | once_cell = "1.3.1" |
diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs index 1a5a6dc06..fa3be1016 100644 --- a/crates/ra_syntax/src/parsing/lexer.rs +++ b/crates/ra_syntax/src/parsing/lexer.rs | |||
@@ -1,6 +1,8 @@ | |||
1 | //! Lexer analyzes raw input string and produces lexemes (tokens). | 1 | //! Lexer analyzes raw input string and produces lexemes (tokens). |
2 | //! It is just a bridge to `rustc_lexer`. | 2 | //! It is just a bridge to `rustc_lexer`. |
3 | 3 | ||
4 | use rustc_lexer::{LiteralKind as LK, RawStrError}; | ||
5 | |||
4 | use std::convert::TryInto; | 6 | use std::convert::TryInto; |
5 | 7 | ||
6 | use crate::{ | 8 | use crate::{ |
@@ -180,8 +182,6 @@ fn rustc_token_kind_to_syntax_kind( | |||
180 | return (syntax_kind, None); | 182 | return (syntax_kind, None); |
181 | 183 | ||
182 | fn match_literal_kind(kind: &rustc_lexer::LiteralKind) -> (SyntaxKind, Option<&'static str>) { | 184 | fn match_literal_kind(kind: &rustc_lexer::LiteralKind) -> (SyntaxKind, Option<&'static str>) { |
183 | use rustc_lexer::{LexRawStrError, LiteralKind as LK}; | ||
184 | |||
185 | #[rustfmt::skip] | 185 | #[rustfmt::skip] |
186 | let syntax_kind = match *kind { | 186 | let syntax_kind = match *kind { |
187 | LK::Int { empty_int: false, .. } => INT_NUMBER, | 187 | LK::Int { empty_int: false, .. } => INT_NUMBER, |
@@ -215,27 +215,27 @@ fn rustc_token_kind_to_syntax_kind( | |||
215 | return (BYTE_STRING, Some("Missing trailing `\"` symbol to terminate the byte string literal")) | 215 | return (BYTE_STRING, Some("Missing trailing `\"` symbol to terminate the byte string literal")) |
216 | } | 216 | } |
217 | 217 | ||
218 | LK::RawStr(str) => match str.validate() { | 218 | LK::RawStr { err, .. } => match err { |
219 | Ok(_) => RAW_STRING, | 219 | None => RAW_STRING, |
220 | Err(LexRawStrError::InvalidStarter) => return (RAW_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw string literal")), | 220 | Some(RawStrError::InvalidStarter { .. }) => return (RAW_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw string literal")), |
221 | Err(LexRawStrError::NoTerminator { expected, found, .. }) => if expected == found { | 221 | Some(RawStrError::NoTerminator { expected, found, .. }) => if expected == found { |
222 | return (RAW_STRING, Some("Missing trailing `\"` to terminate the raw string literal")) | 222 | return (RAW_STRING, Some("Missing trailing `\"` to terminate the raw string literal")) |
223 | } else { | 223 | } else { |
224 | return (RAW_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw string literal")) | 224 | return (RAW_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw string literal")) |
225 | 225 | ||
226 | }, | 226 | }, |
227 | Err(LexRawStrError::TooManyDelimiters { .. }) => return (RAW_STRING, Some("Too many `#` symbols: raw strings may be delimited by up to 65535 `#` symbols")), | 227 | Some(RawStrError::TooManyDelimiters { .. }) => return (RAW_STRING, Some("Too many `#` symbols: raw strings may be delimited by up to 65535 `#` symbols")), |
228 | }, | 228 | }, |
229 | LK::RawByteStr(str) => match str.validate() { | 229 | LK::RawByteStr { err, .. } => match err { |
230 | Ok(_) => RAW_BYTE_STRING, | 230 | None => RAW_BYTE_STRING, |
231 | Err(LexRawStrError::InvalidStarter) => return (RAW_BYTE_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw byte string literal")), | 231 | Some(RawStrError::InvalidStarter { .. }) => return (RAW_BYTE_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw byte string literal")), |
232 | Err(LexRawStrError::NoTerminator { expected, found, .. }) => if expected == found { | 232 | Some(RawStrError::NoTerminator { expected, found, .. }) => if expected == found { |
233 | return (RAW_BYTE_STRING, Some("Missing trailing `\"` to terminate the raw byte string literal")) | 233 | return (RAW_BYTE_STRING, Some("Missing trailing `\"` to terminate the raw byte string literal")) |
234 | } else { | 234 | } else { |
235 | return (RAW_BYTE_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw byte string literal")) | 235 | return (RAW_BYTE_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw byte string literal")) |
236 | 236 | ||
237 | }, | 237 | }, |
238 | Err(LexRawStrError::TooManyDelimiters { .. }) => return (RAW_BYTE_STRING, Some("Too many `#` symbols: raw byte strings may be delimited by up to 65535 `#` symbols")), | 238 | Some(RawStrError::TooManyDelimiters { .. }) => return (RAW_BYTE_STRING, Some("Too many `#` symbols: raw byte strings may be delimited by up to 65535 `#` symbols")), |
239 | }, | 239 | }, |
240 | }; | 240 | }; |
241 | 241 | ||