MCPcopy Create free account
hub / github.com/corrode/write-yourself-a-shell / parse_next

Method parse_next

examples/block5.rs:167–176  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

165 }
166
167 fn parse_next(&mut self) -> Option<Element> {
168 let next = self.tokens.get(self.current).map(|s| s.to_string());
169 next.and_then(|next| {
170 self.current += 1;
171 match Element::parse_operator(&next) {
172 Some(operator) => Some(operator),
173 None => self.parse_cmd(next.to_string()).map(Element::Cmd),
174 }
175 })
176 }
177
178 fn parse_cmd(&mut self, binary: String) -> Option<Cmd> {
179 let mut args: Vec<String> = vec![];

Callers 1

parseMethod · 0.45

Calls 1

parse_cmdMethod · 0.45

Tested by

no test coverage detected