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

Method parse_xor_expr

parser/src/parser/parser.rs:2114–2127  ·  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

2112
2113 // https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2114 fn parse_xor_expr(&mut self) -> Result<Expression, ParsingError> {
2115 let node = self.start_node();
2116 let mut and_expr = self.parse_and_expr()?;
2117 if self.eat(Kind::BitXor) {
2118 let rhs = self.parse_and_expr()?;
2119 and_expr = Expression::BinOp(Box::new(BinOp {
2120 node: self.finish_node(node),
2121 op: BinaryOperator::BitXor,
2122 left: and_expr,
2123 right: rhs,
2124 }));
2125 }
2126 Ok(and_expr)
2127 }
2128
2129 // https://docs.python.org/3/reference/expressions.html#binary-bitwise-operations
2130 fn parse_and_expr(&mut self) -> Result<Expression, ParsingError> {

Callers 1

parse_or_exprMethod · 0.80

Calls 5

BinOpClass · 0.85
start_nodeMethod · 0.80
parse_and_exprMethod · 0.80
eatMethod · 0.80
finish_nodeMethod · 0.80

Tested by

no test coverage detected