MCPcopy Create free account
hub / github.com/PLSysSec/wave / parse_rust_until

Method parse_rust_until

tools/fuzz-gen/src/specifications/preparser.rs:348–373  ·  view source on GitHub ↗
(&mut self, terminator: &str)

Source from the content-addressed store, hash-verified

346 }
347
348 fn parse_rust_until(&mut self, terminator: &str) -> syn::Result<ExpressionWithoutId> {
349 let mut t = vec![];
350
351 while !self.peek_operator("|=") &&
352 !self.peek_operator("&&") &&
353 !self.peek_operator("==>") &&
354 !self.peek_operator(terminator) &&
355 !self.tokens.is_empty() {
356 t.push(self.pop().unwrap());
357 }
358 let mut stream = TokenStream::new();
359 stream.extend(t.into_iter());
360
361 let cloned: VecDeque<TokenTree> = stream.clone().into_iter().collect();
362 if let Some(span) = self.contains_operator_recursive(&cloned, "==>") {
363 Err(self.error_no_implies(span))
364 } else if cloned.is_empty() {
365 Err(self.error_expected("expression"))
366 } else {
367 Ok(ExpressionWithoutId {
368 spec_id: common::SpecificationId::dummy(),
369 id: (),
370 expr: syn::parse2(stream)?,
371 })
372 }
373 }
374
375 /// is there any non-prusti operator following the first thing?
376 fn is_part_of_rust_expr(&mut self) -> bool {

Callers 2

parse_entailmentMethod · 0.80

Calls 8

peek_operatorMethod · 0.80
is_emptyMethod · 0.80
into_iterMethod · 0.80
error_no_impliesMethod · 0.80
error_expectedMethod · 0.80
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected