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

Method rest_of_line

cranelift/reader/src/lexer.rs:229–237  ·  view source on GitHub ↗

Get the rest of the current line. The next token returned by `next()` will be from the following lines.

(&mut self)

Source from the content-addressed store, hash-verified

227 /// Get the rest of the current line.
228 /// The next token returned by `next()` will be from the following lines.
229 pub fn rest_of_line(&mut self) -> &'a str {
230 let begin = self.pos;
231 loop {
232 match self.next_ch() {
233 None | Some('\n') => return &self.source[begin..self.pos],
234 _ => {}
235 }
236 }
237 }
238
239 // Scan a comment extending to the end of the current line.
240 fn scan_comment(&mut self) -> Result<LocatedToken<'a>, LocatedError> {

Callers 2

consume_lineMethod · 0.80
scan_commentMethod · 0.80

Calls 1

next_chMethod · 0.80

Tested by

no test coverage detected