(
tokens: &[Token],
position: &mut usize,
)
| 12 | const INTERVAL_MAX_VALUE: i64 = 170_000_000; |
| 13 | |
| 14 | pub(crate) fn parse_interval_expression( |
| 15 | tokens: &[Token], |
| 16 | position: &mut usize, |
| 17 | ) -> Result<Box<dyn Expr>, Box<Diagnostic>> { |
| 18 | consume_token_or_error( |
| 19 | tokens, |
| 20 | position, |
| 21 | TokenKind::Interval, |
| 22 | "Expect 'Interval' Keyword", |
| 23 | )?; |
| 24 | |
| 25 | let interval_value_token = consume_conditional_token_or_errors( |
| 26 | tokens, |
| 27 | position, |
| 28 | |t| matches!(t.kind, TokenKind::String(_)), |
| 29 | "Expect String after 'Interval' Keyword as interval value", |
| 30 | )?; |
| 31 | |
| 32 | let interval = parse_interval_literal( |
| 33 | &interval_value_token.to_string(), |
| 34 | interval_value_token.location, |
| 35 | )?; |
| 36 | |
| 37 | Ok(Box::new(IntervalExpr::new(interval))) |
| 38 | } |
| 39 | |
| 40 | /// Parse string into Interval expression. |
| 41 | /// |
no test coverage detected
searching dependent graphs…