aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Ruckerbauer <[email protected]>2020-05-30 13:09:10 +0100
committerRoland Ruckerbauer <[email protected]>2020-05-30 13:09:10 +0100
commita27ede88a3a9063a3a2265b668b1c41b589852f5 (patch)
treef7aa1601624ed30ceb19cd4ce26cc542a3b1c658
parent07060b3daa9592090da45245ea13c28304449d9d (diff)
Fix problem with format string tokenization
Fixed by just not handling closing curlybrace escaping.
-rw-r--r--crates/ra_syntax/src/ast/tokens.rs5
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 _ => {