MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / un_expected_query_start_error

Function un_expected_query_start_error

crates/gitql-parser/src/parser.rs:3737–3753  ·  view source on GitHub ↗
(tokens: &[Token], position: &mut usize)

Source from the content-addressed store, hash-verified

3735}
3736
3737fn 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
3755fn un_expected_expression_error(tokens: &[Token], position: &usize) -> Box<Diagnostic> {
3756 let location = calculate_safe_location(tokens, *position);

Callers 1

parse_gqlFunction · 0.85

Calls 3

as_boxedMethod · 0.80
with_locationMethod · 0.80
add_helpMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…