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

Method parse_bin_arithmetic_op

parser/src/parser/parser.rs:3119–3139  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

3117 }
3118
3119 fn parse_bin_arithmetic_op(&mut self) -> Result<BinaryOperator, ParsingError> {
3120 let op = match self.cur_kind() {
3121 Kind::Plus => Ok(BinaryOperator::Add),
3122 Kind::Minus => Ok(BinaryOperator::Sub),
3123 Kind::Mul => Ok(BinaryOperator::Mult),
3124 Kind::Div => Ok(BinaryOperator::Div),
3125 Kind::IntDiv => Ok(BinaryOperator::FloorDiv),
3126 Kind::Mod => Ok(BinaryOperator::Mod),
3127 Kind::Pow => Ok(BinaryOperator::Pow),
3128 Kind::MatrixMul => Ok(BinaryOperator::MatMult),
3129 _ => {
3130 // Err(self
3131 // .unepxted_token(self.start_node(), self.cur_kind())
3132 // .err()
3133 // .unwrap()),
3134 panic!();
3135 }
3136 };
3137 self.bump_any();
3138 op
3139 }
3140
3141 fn parse_keyword_item(&mut self) -> Result<Keyword, ParsingError> {
3142 let node = self.start_node();

Callers

nothing calls this directly

Calls 2

cur_kindMethod · 0.80
bump_anyMethod · 0.80

Tested by

no test coverage detected