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

Method looking_at_numeric

cranelift/reader/src/lexer.rs:189–203  ·  view source on GitHub ↗

Starting from `lookahead`, are we looking at a number?

(&self)

Source from the content-addressed store, hash-verified

187
188 // Starting from `lookahead`, are we looking at a number?
189 fn looking_at_numeric(&self) -> bool {
190 if let Some(c) = self.lookahead {
191 match c {
192 '0'..='9' => return true,
193 '-' => return true,
194 '+' => return true,
195 '.' => return true,
196 _ => {}
197 }
198 if self.looking_at("NaN") || self.looking_at("Inf") || self.looking_at("sNaN") {
199 return true;
200 }
201 }
202 false
203 }
204
205 // Scan a single-char token.
206 fn scan_char(&mut self, tok: Token<'a>) -> Result<LocatedToken<'a>, LocatedError> {

Callers 1

scan_numberMethod · 0.80

Calls 1

looking_atMethod · 0.80

Tested by

no test coverage detected