(&mut self)
| 3081 | } |
| 3082 | |
| 3083 | fn parse_comp_operator(&mut self) -> Result<ComparisonOperator, ParsingError> { |
| 3084 | let node = self.start_node(); |
| 3085 | let op = match self.cur_kind() { |
| 3086 | Kind::Less => ComparisonOperator::Lt, |
| 3087 | Kind::Greater => ComparisonOperator::Gt, |
| 3088 | Kind::LessEq => ComparisonOperator::LtE, |
| 3089 | Kind::GreaterEq => ComparisonOperator::GtE, |
| 3090 | Kind::Eq => ComparisonOperator::Eq, |
| 3091 | Kind::NotEq => ComparisonOperator::NotEq, |
| 3092 | Kind::In => ComparisonOperator::In, |
| 3093 | Kind::Is => match self.peek_kind() { |
| 3094 | Ok(Kind::Not) => { |
| 3095 | self.bump_any(); |
| 3096 | ComparisonOperator::IsNot |
| 3097 | } |
| 3098 | _ => ComparisonOperator::Is, |
| 3099 | }, |
| 3100 | Kind::Not => match self.peek_kind() { |
| 3101 | Ok(Kind::In) => { |
| 3102 | self.bump_any(); |
| 3103 | ComparisonOperator::NotIn |
| 3104 | } |
| 3105 | _ => { |
| 3106 | // return Err(self.unepxted_token(node, self.cur_kind()).err().unwrap()); |
| 3107 | panic!(); |
| 3108 | } |
| 3109 | }, |
| 3110 | _ => { |
| 3111 | // return Err(self.unepxted_token(node, self.cur_kind()).err().unwrap()); |
| 3112 | panic!(); |
| 3113 | } |
| 3114 | }; |
| 3115 | self.bump_any(); |
| 3116 | Ok(op) |
| 3117 | } |
| 3118 | |
| 3119 | fn parse_bin_arithmetic_op(&mut self) -> Result<BinaryOperator, ParsingError> { |
| 3120 | let op = match self.cur_kind() { |
no test coverage detected