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

Method parse_operator

examples/block4.rs:231–237  ·  view source on GitHub ↗
(token: &str)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected