mirror of
https://github.com/github/semantic.git
synced 2025-01-03 21:16:12 +03:00
Prepend the diff if it's not a deletion/insertion
This commit is contained in:
parent
f16874fe6c
commit
b51198393e
@ -78,9 +78,8 @@ rws compare as bs
|
||||
(fas, fbs, _, _, diffs) = foldr' (\diff (as, bs, counterA, counterB, diffs) -> case runFree diff of
|
||||
Pure (Right (Delete term)) -> (featurize counterA term : as, bs, succ counterA, counterB, diffs)
|
||||
Pure (Right (Insert term)) -> (as, featurize counterB term : bs, counterA, succ counterB, diffs)
|
||||
syntax@(Free _) -> let diff' = free syntax >>= either identity pure in (as, bs, counterA, counterB, diff' : diffs) -- (featurize counterA term : as, bs, succ counterA, counterB)
|
||||
-- Pure (Left term) -> (as, featurize counterB term : bs, counterA, succ counterB)
|
||||
_ -> (as, bs, succ counterA, succ counterB, diffs)
|
||||
syntax -> let diff' = free syntax >>= either identity pure in
|
||||
(as, bs, succ counterA, succ counterB, diff' : diffs)
|
||||
) ([], [], 0, 0, []) sesDiff
|
||||
|
||||
kdas = KdTree.build (Vector.toList . feature) fas
|
||||
|
Loading…
Reference in New Issue
Block a user