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

Method parse_decl

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

Source from the content-addressed store, hash-verified

366 }
367
368 fn parse_decl(&mut self) -> Result<Decl> {
369 let pos = self.pos();
370
371 let pure = self.eat_sym_str("pure")?;
372 let multi = self.eat_sym_str("multi")?;
373 let partial = self.eat_sym_str("partial")?;
374 let rec = self.eat_sym_str("rec")?;
375
376 let term = self.parse_ident()?;
377
378 self.expect_lparen()?;
379 let mut arg_tys = vec![];
380 while !self.is_rparen() {
381 arg_tys.push(self.parse_ident()?);
382 }
383 self.expect_rparen()?;
384
385 let ret_ty = self.parse_ident()?;
386
387 Ok(Decl {
388 term,
389 arg_tys,
390 ret_ty,
391 pure,
392 multi,
393 partial,
394 rec,
395 pos,
396 })
397 }
398
399 fn parse_spec(&mut self) -> Result<Spec> {
400 let pos = self.pos();

Callers 1

parse_defMethod · 0.80

Calls 8

OkFunction · 0.85
eat_sym_strMethod · 0.80
parse_identMethod · 0.80
expect_lparenMethod · 0.80
is_rparenMethod · 0.80
expect_rparenMethod · 0.80
posMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected