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

Function parse_global_variable_expression

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

Source from the content-addressed store, hash-verified

3720}
3721
3722fn parse_global_variable_expression(
3723 env: &mut Environment,
3724 tokens: &[Token],
3725 position: &mut usize,
3726) -> Result<Box<dyn Expr>, Box<Diagnostic>> {
3727 let name = tokens[*position].to_string();
3728 *position += 1;
3729 let result_type = if env.globals_types.contains_key(&name) {
3730 env.globals_types[name.as_str()].clone()
3731 } else {
3732 Box::new(UndefType)
3733 };
3734 Ok(Box::new(GlobalVariableExpr { name, result_type }))
3735}
3736
3737fn un_expected_query_start_error(tokens: &[Token], position: &mut usize) -> Box<Diagnostic> {
3738 let token: &Token = &tokens[*position];

Callers 1

parse_primary_expressionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…