MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / scan_string

Method scan_string

cranelift/reader/src/lexer.rs:417–435  ·  view source on GitHub ↗

Scan for a multi-line quoted string with no escape character.

(&mut self)

Source from the content-addressed store, hash-verified

415
416 /// Scan for a multi-line quoted string with no escape character.
417 fn scan_string(&mut self) -> Result<LocatedToken<'a>, LocatedError> {
418 let loc = self.loc();
419 let begin = self.pos + 1;
420
421 assert_eq!(self.lookahead, Some('"'));
422
423 while let Some(c) = self.next_ch() {
424 if c == '"' {
425 break;
426 }
427 }
428
429 let end = self.pos;
430 if self.lookahead != Some('"') {
431 return error(LexError::InvalidChar, self.loc());
432 }
433 self.next_ch();
434 token(Token::String(&self.source[begin..end]), loc)
435 }
436
437 fn scan_hex_sequence(&mut self) -> Result<LocatedToken<'a>, LocatedError> {
438 let loc = self.loc();

Callers 1

nextMethod · 0.80

Calls 4

errorFunction · 0.85
tokenFunction · 0.85
locMethod · 0.80
next_chMethod · 0.80

Tested by

no test coverage detected