Skip to content

Commit

Permalink
Remove deprecated DotDot operator helper
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Nov 20, 2024
1 parent df38b70 commit 51581c7
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions crates/gitql-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ fn parse_from_option(
register_current_table_fields_types(env, &table_name)?;

// Parse Joins
let mut number_previous_of_joines = 0;
let mut number_previous_of_joins = 0;
while is_join_or_join_type_token(tokens, position) {
let join_token = &tokens[*position];

Expand Down Expand Up @@ -826,7 +826,7 @@ fn parse_from_option(
let other_table_name = &other_table.to_string();

// Make sure the RIGHT and LEFT tables names are not the same
if number_previous_of_joines == 0 && table_name.eq(other_table_name) {
if number_previous_of_joins == 0 && table_name.eq(other_table_name) {
return Err(Diagnostic::error(
"The two tables of join must be unique or have different alias",
)
Expand Down Expand Up @@ -858,7 +858,7 @@ fn parse_from_option(
.as_boxed());
}

let join_operand = if number_previous_of_joines == 0 {
let join_operand = if number_previous_of_joins == 0 {
JoinOperand::OuterAndInner(table_name.to_string(), other_table_name.to_string())
} else {
JoinOperand::Inner(other_table_name.to_string())
Expand All @@ -870,7 +870,7 @@ fn parse_from_option(
predicate,
});

number_previous_of_joines += 1;
number_previous_of_joins += 1;
}
}
Ok(())
Expand Down Expand Up @@ -4048,14 +4048,6 @@ fn un_expected_expression_error(tokens: &[Token], position: &usize) -> Box<Diagn
.as_boxed();
}

// `. .` the user may want to write `..`
if previous.kind == TokenKind::Dot && current.kind == TokenKind::Dot {
return Diagnostic::error("Unexpected `. .`, do you mean `..`?")
.add_help("Try to remove space between `. .`")
.with_location(location)
.as_boxed();
}

// Default error message
Diagnostic::error("Can't complete parsing this expression")
.with_location(location)
Expand Down

0 comments on commit 51581c7

Please sign in to comment.