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

Method parse_and_expr

parser/src/parser/parser.rs:2130–2144  ·  view source on GitHub ↗

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

(&mut self)

Source from the content-addressed store, hash-verified

2128
2129 // https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2130 fn parse_and_expr(&mut self) -> Result<Expression, ParsingError> {
2131 let node = self.start_node();
2132 let mut shift_expr = self.parse_shift_expr()?;
2133
2134 while self.eat(Kind::BitAnd) {
2135 let rhs = self.parse_shift_expr()?;
2136 shift_expr = Expression::BinOp(Box::new(BinOp {
2137 node: self.finish_node(node),
2138 op: BinaryOperator::BitAnd,
2139 left: shift_expr,
2140 right: rhs,
2141 }));
2142 }
2143 Ok(shift_expr)
2144 }
2145
2146 // https://docs.python.org/3/reference/expressions.html#shifting-operations
2147 fn parse_shift_expr(&mut self) -> Result<Expression, ParsingError> {

Callers 1

parse_xor_exprMethod · 0.80

Calls 5

BinOpClass · 0.85
start_nodeMethod · 0.80
parse_shift_exprMethod · 0.80
eatMethod · 0.80
finish_nodeMethod · 0.80

Tested by

no test coverage detected