Keep exploring the graph even when we find matched delimiters

Previously we'd get tripped up by cases where choosing equal
delimiters would be be considered the same as entering each delimiter
separately, making diffs worse.

Fixes #147
pull/166/head
Wilfred Hughes 2022-03-13 15:35:53 +07:00
parent bd6a1cbdc6
commit c0d1faae63
4 changed files with 12 additions and 2 deletions

@ -0,0 +1 @@
[(lhs) comma rhs]

@ -0,0 +1 @@
(lhs comma rhs)

@ -1,6 +1,9 @@
sample_files/bad_combine_before.rs sample_files/bad_combine_after.rs
ffb31b7f11712d0e28a7f874bb7756c6 -
sample_files/change_outer_before.el sample_files/change_outer_after.el
1e144818ad54091b05e58e2c617add8f -
sample_files/clojure_before.clj sample_files/clojure_after.clj
8316bcd959ce706ac07011f6dc31c93a -
@ -77,10 +80,10 @@ sample_files/simple_before.txt sample_files/simple_after.txt
4b653ebe89321835c35722dd065cf6a2 -
sample_files/slider_before.rs sample_files/slider_after.rs
9b21c5790773eaba1a83e92fe2b9b5a8 -
ab11d8dfc684921d85f49d3ec4dfeec4 -
sample_files/slow_before.rs sample_files/slow_after.rs
07c6dda6ca91de93a0553f90060697d0 -
1f6176a6518e16eb8dfe32d7d81c63d9 -
sample_files/small_before.js sample_files/small_after.js
ee97a525a74be6dd18e959395d02265b -

@ -71,6 +71,11 @@ impl<'a> PartialEq for Vertex<'a> {
// the graph size relative to tree depth.
&& self.lhs_parent_id == other.lhs_parent_id
&& self.rhs_parent_id == other.rhs_parent_id
// We do want to distinguish whether we can pop each side
// independently though. Without this, if we find a case
// where we can pop sides together, we don't consider the
// case where we get a better diff by popping each side
// separately.
&& self.can_pop_either == other.can_pop_either
}
}