(tokens: &[Token], position: &mut usize)
| 3735 | } |
| 3736 | |
| 3737 | fn un_expected_query_start_error(tokens: &[Token], position: &mut usize) -> Box<Diagnostic> { |
| 3738 | let token: &Token = &tokens[*position]; |
| 3739 | let location = token.location; |
| 3740 | |
| 3741 | // Query starts with invalid keyword |
| 3742 | if *position == 0 { |
| 3743 | return Diagnostic::error("Unexpected query start") |
| 3744 | .add_help("Expect query to start with `SELECT`, `DO`, `SET` or `DESCRIBE` keyword") |
| 3745 | .with_location(location) |
| 3746 | .as_boxed(); |
| 3747 | } |
| 3748 | |
| 3749 | // General un expected query error |
| 3750 | Diagnostic::error("Unexpected statement") |
| 3751 | .with_location(location) |
| 3752 | .as_boxed() |
| 3753 | } |
| 3754 | |
| 3755 | fn un_expected_expression_error(tokens: &[Token], position: &usize) -> Box<Diagnostic> { |
| 3756 | let location = calculate_safe_location(tokens, *position); |
no test coverage detected
searching dependent graphs…