MCPcopy Create free account
hub / github.com/Glyphack/enderpy / parse_or_expr

Method parse_or_expr

parser/src/parser/parser.rs:2098–2111  ·  view source on GitHub ↗

Binary bitwise operations https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations

(&mut self)

Source from the content-addressed store, hash-verified

2096 // Binary bitwise operations
2097 // https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2098 fn parse_or_expr(&mut self) -> Result<Expression, ParsingError> {
2099 let node = self.start_node();
2100 let mut lhs = self.parse_xor_expr()?;
2101 while self.eat(Kind::BitOr) {
2102 let rhs = self.parse_xor_expr()?;
2103 lhs = Expression::BinOp(Box::new(BinOp {
2104 node: self.finish_node(node),
2105 op: BinaryOperator::BitOr,
2106 left: lhs,
2107 right: rhs,
2108 }));
2109 }
2110 Ok(lhs)
2111 }
2112
2113 // https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2114 fn parse_xor_expr(&mut self) -> Result<Expression, ParsingError> {

Callers 4

parse_starred_itemMethod · 0.80
parse_comparisonMethod · 0.80

Calls 5

BinOpClass · 0.85
start_nodeMethod · 0.80
parse_xor_exprMethod · 0.80
eatMethod · 0.80
finish_nodeMethod · 0.80

Tested by

no test coverage detected