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

Method extract_assertion

tools/fuzz-gen/src/specifications/preparser.rs:92–109  ·  view source on GitHub ↗

Creates a single Prusti assertion from the input and returns it.

(&mut self)

Source from the content-addressed store, hash-verified

90 }
91 /// Creates a single Prusti assertion from the input and returns it.
92 pub fn extract_assertion(&mut self) -> syn::Result<AssertionWithoutId> {
93 if self.tokens.is_empty() {
94 Ok(AssertionWithoutId {
95 kind: Box::new(common::AssertionKind::And(vec![]))
96 })
97 } else {
98 if let Some(span) = self.contains_both_and_or(&self.tokens) {
99 return Err(self.error_ambiguous_expression(span));
100 }
101
102 let expr = self.parse_prusti()?;
103 if self.pop().is_some() {
104 Err(self.error_unexpected())
105 } else {
106 Ok(expr)
107 }
108 }
109 }
110 /// Create a pledge from the input
111 pub fn extract_pledge(&mut self) -> syn::Result<PledgeWithoutId> {
112 let pledge = self.parse_pledge()?;

Callers 4

parse_assertionMethod · 0.80
parseMethod · 0.80
parse_primaryMethod · 0.80

Calls 6

is_emptyMethod · 0.80
contains_both_and_orMethod · 0.80
parse_prustiMethod · 0.80
error_unexpectedMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected