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

Method new

cranelift/reader/src/lexer.rs:143–154  ·  view source on GitHub ↗
(s: &'a str)

Source from the content-addressed store, hash-verified

141
142impl<'a> Lexer<'a> {
143 pub fn new(s: &'a str) -> Self {
144 let mut lex = Self {
145 source: s,
146 chars: s.char_indices(),
147 lookahead: None,
148 pos: 0,
149 line_number: 1,
150 };
151 // Advance to the first char.
152 lex.next_ch();
153 lex
154 }
155
156 // Advance to the next character.
157 // Return the next lookahead character, or None when the end is encountered.

Callers

nothing calls this directly

Calls 1

next_chMethod · 0.80

Tested by

no test coverage detected