MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_quoted_literal

Method check_quoted_literal

crates/vm/src/vm/compile.rs:211–217  ·  view source on GitHub ↗

Check a quoted string/bytes literal for invalid escapes. The range must include the prefix and quote delimiters.

(&self, range: TextRange, is_bytes: bool)

Source from the content-addressed store, hash-verified

209 /// Check a quoted string/bytes literal for invalid escapes.
210 /// The range must include the prefix and quote delimiters.
211 fn check_quoted_literal(&self, range: TextRange, is_bytes: bool) {
212 if let Some((start, end)) = content_bounds(self.source, range)
213 && let Some((ch, offset)) = first_invalid_escape(self.source, start, end, is_bytes)
214 {
215 warn_invalid_escape_sequence(self.source, ch, offset, self.filename, self.vm);
216 }
217 }
218
219 /// Check an f-string literal element for invalid escapes.
220 /// The range covers content only (no prefix/quotes).

Callers 1

visit_exprMethod · 0.80

Calls 3

content_boundsFunction · 0.85
first_invalid_escapeFunction · 0.85

Tested by

no test coverage detected