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

Method visit_fstring_elements

crates/vm/src/vm/compile.rs:262–276  ·  view source on GitHub ↗

Visit f-string elements, checking literals and recursing into interpolation expressions and format specs.

(&mut self, elements: &'a ast::InterpolatedStringElements)

Source from the content-addressed store, hash-verified

260 /// Visit f-string elements, checking literals and recursing into
261 /// interpolation expressions and format specs.
262 fn visit_fstring_elements(&mut self, elements: &'a ast::InterpolatedStringElements) {
263 for element in elements {
264 match element {
265 ast::InterpolatedStringElement::Literal(lit) => {
266 self.check_fstring_literal(lit.range);
267 }
268 ast::InterpolatedStringElement::Interpolation(interp) => {
269 self.visit_expr(&interp.expression);
270 if let Some(spec) = &interp.format_spec {
271 self.visit_fstring_elements(&spec.elements);
272 }
273 }
274 }
275 }
276 }
277 }
278
279 impl<'a> Visitor<'a> for EscapeWarningVisitor<'a> {

Callers 1

visit_exprMethod · 0.80

Calls 2

check_fstring_literalMethod · 0.80
visit_exprMethod · 0.45

Tested by

no test coverage detected