(
context: &mut ParserContext,
env: &mut Environment,
tokens: &[Token],
position: &mut usize,
)
| 1224 | } |
| 1225 | |
| 1226 | fn parse_offset_statement( |
| 1227 | context: &mut ParserContext, |
| 1228 | env: &mut Environment, |
| 1229 | tokens: &[Token], |
| 1230 | position: &mut usize, |
| 1231 | ) -> Result<Statement, Box<Diagnostic>> { |
| 1232 | // Consume `OFFSET` keyword |
| 1233 | *position += 1; |
| 1234 | |
| 1235 | if *position >= tokens.len() { |
| 1236 | return Err(Diagnostic::error("Expect number after `OFFSET` keyword") |
| 1237 | .with_location(calculate_safe_location(tokens, *position - 1)) |
| 1238 | .as_boxed()); |
| 1239 | } |
| 1240 | |
| 1241 | let start = parse_expression(context, env, tokens, position)?; |
| 1242 | if start.expr_type().is_int() { |
| 1243 | return Ok(Statement::Offset(OffsetStatement { start })); |
| 1244 | } |
| 1245 | |
| 1246 | Err(Diagnostic::error("Expect int after `OFFSET` keyword") |
| 1247 | .with_location(calculate_safe_location(tokens, *position - 1)) |
| 1248 | .as_boxed()) |
| 1249 | } |
| 1250 | |
| 1251 | fn parse_window_named_over_clause( |
| 1252 | context: &mut ParserContext, |
no test coverage detected
searching dependent graphs…