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

Method parse_operator

examples/block5.rs:229–236  ·  view source on GitHub ↗
(token: &str)

Source from the content-addressed store, hash-verified

227
228impl Element {
229 fn parse_operator(token: &str) -> Option<Self> {
230 match token {
231 "|" => Some(Self::Pipe),
232 "&&" => Some(Self::And),
233 "||" => Some(Self::Or),
234 _ => None,
235 }
236 }
237
238 fn is_operator(token: &str) -> bool {
239 Self::parse_operator(token).is_some()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected