1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

Add Operator case to run

This commit is contained in:
Rick Winfrey 2016-06-17 17:03:39 -05:00
parent e8fcd3390e
commit ee799b2b67

View File

@ -68,6 +68,7 @@ run construct comparable cost algorithm = case runFree algorithm of
recur (Args as') (Args bs') = annotate . Args $ zipWith diffTerms' as' bs' recur (Args as') (Args bs') = annotate . Args $ zipWith diffTerms' as' bs'
recur (VarDecl a') (VarDecl b') = annotate . VarDecl $ diffTerms' a' b' recur (VarDecl a') (VarDecl b') = annotate . VarDecl $ diffTerms' a' b'
recur (VarAssignment a' as') (VarAssignment b' bs') = annotate $ VarAssignment (diffTerms' a' b') (diffTerms' as' bs') recur (VarAssignment a' as') (VarAssignment b' bs') = annotate $ VarAssignment (diffTerms' a' b') (diffTerms' as' bs')
recur (Operator a') (Operator b') = annotate $ Operator (zipWith diffTerms' a' b')
recur (Switch a' as') (Switch b' bs') = annotate $ Switch (diffTerms' a' b') (alignWith (these (pure . Delete) (pure . Insert) diffTerms') as' bs') recur (Switch a' as') (Switch b' bs') = annotate $ Switch (diffTerms' a' b') (alignWith (these (pure . Delete) (pure . Insert) diffTerms') as' bs')
recur (Case a' as') (Case b' bs') = annotate $ Case (diffTerms' a' b') (diffTerms' as' bs') recur (Case a' as') (Case b' bs') = annotate $ Case (diffTerms' a' b') (diffTerms' as' bs')
recur (Leaf _) (Leaf _) = pure $ Replace (cofree (annotation1 :< a)) (cofree (annotation2 :< b)) recur (Leaf _) (Leaf _) = pure $ Replace (cofree (annotation1 :< a)) (cofree (annotation2 :< b))