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

Method parse_next

examples/block2.rs:53–62  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

51 }
52
53 fn parse_next(&mut self) -> Option<Element> {
54 let next = self.tokens.get(self.current).map(|s| s.to_string());
55 next.and_then(|next| {
56 self.current += 1;
57 match Element::parse_operator(&next) {
58 Some(operator) => Some(operator),
59 None => self.parse_cmd(next.to_string()).map(Element::Cmd),
60 }
61 })
62 }
63
64 fn parse_cmd(&mut self, binary: String) -> Option<Cmd> {
65 let mut args: Vec<String> = vec![];

Callers 1

parseMethod · 0.45

Calls 1

parse_cmdMethod · 0.45

Tested by

no test coverage detected