https://docs.python.org/3/reference/expressions.html#shifting-operations
(&mut self)
| 2145 | |
| 2146 | // https://docs.python.org/3/reference/expressions.html#shifting-operations |
| 2147 | fn parse_shift_expr(&mut self) -> Result<Expression, ParsingError> { |
| 2148 | let node = self.start_node(); |
| 2149 | let mut arith_expr = self.parse_binary_arithmetic_operation(0)?; |
| 2150 | if self.at(Kind::LeftShift) || self.at(Kind::RightShift) { |
| 2151 | let op = if self.eat(Kind::LeftShift) { |
| 2152 | BinaryOperator::LShift |
| 2153 | } else { |
| 2154 | self.bump(Kind::RightShift); |
| 2155 | BinaryOperator::RShift |
| 2156 | }; |
| 2157 | let lhs = self.parse_binary_arithmetic_operation(0)?; |
| 2158 | arith_expr = Expression::BinOp(Box::new(BinOp { |
| 2159 | node: self.finish_node(node), |
| 2160 | op, |
| 2161 | left: arith_expr, |
| 2162 | right: lhs, |
| 2163 | })); |
| 2164 | } |
| 2165 | Ok(arith_expr) |
| 2166 | } |
| 2167 | |
| 2168 | // https://docs.python.org/3/reference/expressions.html#binary-arithmetic-operations |
| 2169 | // |
no test coverage detected