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

Method scan_single_string

compiler/src/modules/lexer/scan.rs:160–174  ·  view source on GitHub ↗
(&mut self, quote: u8, start: usize)

Source from the content-addressed store, hash-verified

158 }
159
160 fn scan_single_string(&mut self, quote: u8, start: usize) {
161 while self.pos < self.src.len() {
162 let b = self.src[self.pos];
163 if b == quote { self.pos += 1; return; }
164 if b == b'\\' && self.at(1).is_some() { self.pos += 1; }
165 if b == b'\n' {
166 /* Anchor unterminated-string error at the opener so `^` lands on the quote, not end-of-line. */
167 self.report(start, start + 1, "unterminated string literal");
168 return;
169 }
170 self.pos += 1;
171 }
172 // Hit EOF without closing quote.
173 self.report(start, start + 1, "unterminated string literal");
174 }
175
176 fn scan_triple_string(&mut self, quote: u8, start: usize) {
177 while self.pos < self.src.len() {

Callers 1

scan_stringMethod · 0.80

Calls 3

reportMethod · 0.80
lenMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected