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

Method parse_type

cranelift/isle/isle/src/parser.rs:251–280  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

249 }
250
251 fn parse_type(&mut self) -> Result<Type> {
252 let pos = self.pos();
253 let name = self.parse_ident()?;
254
255 let mut is_extern = false;
256 let mut is_nodebug = false;
257
258 while self.lexer.peek().map_or(false, |(_pos, tok)| tok.is_sym()) {
259 let sym = self.expect_symbol()?;
260 if sym == "extern" {
261 is_extern = true;
262 } else if sym == "nodebug" {
263 is_nodebug = true;
264 } else {
265 return Err(self.error(
266 self.pos(),
267 format!("unknown type declaration modifier: {sym}"),
268 ));
269 }
270 }
271
272 let ty = self.parse_typevalue()?;
273 Ok(Type {
274 name,
275 is_extern,
276 is_nodebug,
277 ty,
278 pos,
279 })
280 }
281
282 fn parse_typevalue(&mut self) -> Result<TypeValue> {
283 let pos = self.pos();

Callers 1

parse_defMethod · 0.80

Calls 8

OkFunction · 0.85
parse_identMethod · 0.80
expect_symbolMethod · 0.80
parse_typevalueMethod · 0.80
posMethod · 0.45
peekMethod · 0.45
is_symMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected