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

Method parse_operator

examples/block2.rs:117–123  ·  view source on GitHub ↗
(token: &str)

Source from the content-addressed store, hash-verified

115
116impl Element {
117 fn parse_operator(token: &str) -> Option<Self> {
118 match token {
119 "&&" => Some(Self::And),
120 "||" => Some(Self::Or),
121 _ => None,
122 }
123 }
124
125 fn is_operator(token: &str) -> bool {
126 Self::parse_operator(token).is_some()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected