Skip to content

Commit

Permalink
fix: Diagnostic position when parsing undefined symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Aug 5, 2024
1 parent 24f66ba commit 49a1b15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/gitql-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2480,8 +2480,6 @@ fn parse_symbol_expression(
context.projection_locations.push(location);
}

*position += 1;

if context.has_select_statement {
// Replace name by alias if it used after select statement
// This workaround will help to execute query like
Expand All @@ -2502,6 +2500,9 @@ fn parse_symbol_expression(
}
}

// Consume Symbol
*position += 1;

Ok(Box::new(SymbolExpression { value }))
}

Expand Down

0 comments on commit 49a1b15

Please sign in to comment.