MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / start_fstring

Method start_fstring

compiler/src/modules/lexer/scan.rs:192–200  ·  view source on GitHub ↗
(&mut self, start: usize, prefix_end: usize)

Source from the content-addressed store, hash-verified

190 // F-strings: emits Start/Middle/End and suspends at `{`.
191
192 fn start_fstring(&mut self, start: usize, prefix_end: usize) {
193 let quote = self.src[prefix_end];
194 let triple = self.src.get(prefix_end + 1) == Some(&quote) && self.src.get(prefix_end + 2) == Some(&quote);
195 let quote_len = if triple { 3 } else { 1 };
196 self.pos = prefix_end + quote_len;
197 let body_start = self.pos;
198 self.scan_fstring_body(quote, triple, body_start);
199 self.pending.push((TokenType::FstringStart, self.line, start, body_start));
200 }
201
202 fn scan_fstring_body(&mut self, quote: u8, triple: bool, body_start: usize) {
203 let ql: usize = if triple { 3 } else { 1 };

Callers 1

next_tokenMethod · 0.80

Calls 3

scan_fstring_bodyMethod · 0.80
pushMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected