Skip to content

Commit

Permalink
fix(python): simplify check_replacements() to only check if the pre…
Browse files Browse the repository at this point in the history
…v node is empty

fixes getgrit#416
  • Loading branch information
Alex-ley-scrub committed Oct 26, 2024
1 parent bf1a30f commit dcfcf4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/language/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Language for Python {
// https://github.com/getgrit/gritql/issues/416 multi line example
if let Some(prev) = n.node.prev_sibling() {
let empty = prev.range().end_byte() == prev.range().start_byte();
if prev.kind() == "identifier" && empty {
if empty {
replacements.push(Replacement::new(n.range(), ""));
return;
}
Expand Down

0 comments on commit dcfcf4d

Please sign in to comment.