Parse `AS OF`, if present.
(&mut self)
| 8680 | |
| 8681 | /// Parse `AS OF`, if present. |
| 8682 | fn parse_optional_as_of(&mut self) -> Result<Option<AsOf<Raw>>, ParserError> { |
| 8683 | if self.parse_keyword(AS) { |
| 8684 | self.expect_keyword(OF)?; |
| 8685 | if self.parse_keywords(&[AT, LEAST]) { |
| 8686 | match self.parse_expr() { |
| 8687 | Ok(expr) => Ok(Some(AsOf::AtLeast(expr))), |
| 8688 | Err(e) => self.expected( |
| 8689 | e.pos, |
| 8690 | "a timestamp value after 'AS OF AT LEAST'", |
| 8691 | self.peek_token(), |
| 8692 | ), |
| 8693 | } |
| 8694 | } else { |
| 8695 | match self.parse_expr() { |
| 8696 | Ok(expr) => Ok(Some(AsOf::At(expr))), |
| 8697 | Err(e) => { |
| 8698 | self.expected(e.pos, "a timestamp value after 'AS OF'", self.peek_token()) |
| 8699 | } |
| 8700 | } |
| 8701 | } |
| 8702 | } else { |
| 8703 | Ok(None) |
| 8704 | } |
| 8705 | } |
| 8706 | |
| 8707 | /// Parse `UP TO`, if present |
| 8708 | fn parse_optional_up_to(&mut self) -> Result<Option<Expr<Raw>>, ParserError> { |
no test coverage detected