MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / consume_token_until

Method consume_token_until

src/program/serde.rs:149–159  ·  view source on GitHub ↗

eat tokens until meet this `token`. It consumes `token`.

(&mut self, token: &str)

Source from the content-addressed store, hash-verified

147
148 /// eat tokens until meet this `token`. It consumes `token`.
149 pub fn consume_token_until(&mut self, token: &str) -> Result<&'de str> {
150 match self.input.find(token) {
151 Some(len) => {
152 let eaten_tokens = &self.input[..len];
153 self.input = &self.input[len..];
154 self.eat_token(token)?;
155 Ok(eaten_tokens)
156 }
157 None => Err(eyre::eyre!("input `{}` not found {token}", self.input)),
158 }
159 }
160
161 // Parse a string until the next '"' character.
162 pub fn parse_string(&mut self) -> Result<&'de str> {

Callers 8

sync_quiet_roundMethod · 0.80
parse_fuzzer_lcov_dataFunction · 0.80
parse_lcov_dataFunction · 0.80
deserializeMethod · 0.80
parse_pathMethod · 0.80
deserializeMethod · 0.80
get_ubsan_crash_pointFunction · 0.80
parse_call_stack_lineFunction · 0.80

Calls 1

eat_tokenMethod · 0.80

Tested by

no test coverage detected