(&mut self)
| 901 | } |
| 902 | |
| 903 | fn parse_window_frame(&mut self) -> Result<WindowFrame, ParserError> { |
| 904 | let units = match self.expect_one_of_keywords(&[ROWS, RANGE, GROUPS])? { |
| 905 | ROWS => WindowFrameUnits::Rows, |
| 906 | RANGE => WindowFrameUnits::Range, |
| 907 | GROUPS => WindowFrameUnits::Groups, |
| 908 | _ => unreachable!(), |
| 909 | }; |
| 910 | let (start_bound, end_bound) = if self.parse_keyword(BETWEEN) { |
| 911 | let start_bound = self.parse_window_frame_bound()?; |
| 912 | self.expect_keyword(AND)?; |
| 913 | let end_bound = Some(self.parse_window_frame_bound()?); |
| 914 | (start_bound, end_bound) |
| 915 | } else { |
| 916 | (self.parse_window_frame_bound()?, None) |
| 917 | }; |
| 918 | Ok(WindowFrame { |
| 919 | units, |
| 920 | start_bound, |
| 921 | end_bound, |
| 922 | }) |
| 923 | } |
| 924 | |
| 925 | /// Parse `CURRENT ROW` or `{ <positive number> | UNBOUNDED } { PRECEDING | FOLLOWING }` |
| 926 | fn parse_window_frame_bound(&mut self) -> Result<WindowFrameBound, ParserError> { |
no test coverage detected