-
- if let Some(string) = element_to_highlight.into_token().and_then(ast::String::cast) {
- highlight_format_string(hl, &string, range);
- // Highlight escape sequences
- if let Some(char_ranges) = string.char_ranges() {
- for (piece_range, _) in char_ranges.iter().filter(|(_, char)| char.is_ok()) {
- if string.text()[piece_range.start().into()..].starts_with('\\') {
- hl.add(HlRange {
- range: piece_range + range.start(),
- highlight: HlTag::EscapeSequence.into(),
- binding_hash: None,
- });
- }
- }
- }
- }