diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-02 13:13:02 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-02 13:13:02 +0100 |
commit | fe6508bd78944b66b6a4e911b55faea17ddab23d (patch) | |
tree | ea1ea16f9370de39f229e8a5c9a8b4742db4eff3 /crates/ra_syntax/src | |
parent | 131ccd95403e10131d6b8dfcad60ebc49c257c53 (diff) | |
parent | 780c89959a2f7362eb51508d83863eeff9a49e4c (diff) |
Merge #4658
4658: Fix problem with format string tokenization r=matklad a=ruabmbua
Fixed by just not handling closing curlybrace escaping.
Closes https://github.com/rust-analyzer/rust-analyzer/issues/4637
Co-authored-by: Roland Ruckerbauer <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r-- | crates/ra_syntax/src/ast/tokens.rs | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index 3cd6d99c3..04b0a4480 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs | |||
@@ -418,14 +418,9 @@ pub trait HasFormatSpecifier: AstToken { | |||
418 | 418 | ||
419 | let mut cloned = chars.clone().take(2); | 419 | let mut cloned = chars.clone().take(2); |
420 | let first = cloned.next().and_then(|next| next.1.as_ref().ok()).copied(); | 420 | let first = cloned.next().and_then(|next| next.1.as_ref().ok()).copied(); |
421 | let second = cloned.next().and_then(|next| next.1.as_ref().ok()).copied(); | ||
422 | if first != Some('}') { | 421 | if first != Some('}') { |
423 | continue; | 422 | continue; |
424 | } | 423 | } |
425 | if second == Some('}') { | ||
426 | // Escaped format end specifier, `}}` | ||
427 | continue; | ||
428 | } | ||
429 | skip_char_and_emit(&mut chars, FormatSpecifier::Close, &mut callback); | 424 | skip_char_and_emit(&mut chars, FormatSpecifier::Close, &mut callback); |
430 | } | 425 | } |
431 | _ => { | 426 | _ => { |