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

Method eat_token_until

src/program/serde.rs:137–146  ·  view source on GitHub ↗

eat tokens until meet this `token`. It does not consume `token`.

(&mut self, token: &str)

Source from the content-addressed store, hash-verified

135
136 /// eat tokens until meet this `token`. It does not consume `token`.
137 pub fn eat_token_until(&mut self, token: &str) -> Result<&'de str> {
138 match self.input.find(token) {
139 Some(len) => {
140 let eaten_tokens = &self.input[..len];
141 self.input = &self.input[len..];
142 Ok(eaten_tokens)
143 }
144 None => Err(eyre::eyre!("input `{}` not found {token}", self.input)),
145 }
146 }
147
148 /// eat tokens until meet this `token`. It consumes `token`.
149 pub fn consume_token_until(&mut self, token: &str) -> Result<&'de str> {

Callers 5

parse_fuzzer_lcov_dataFunction · 0.80
parse_lcov_dataFunction · 0.80
deserializeMethod · 0.80
parse_call_stack_lineFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected