mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Use alignSyntax to construct Aligned functors.
This commit is contained in:
parent
21356e0144
commit
30e1da5a12
@ -121,7 +121,7 @@ alignPatch sources (Replace term1 term2) = let Join (This info1) :< AlignThis a
|
||||
Join (These info1 info2) :< AlignThese a b
|
||||
|
||||
alignTermBy :: Both (Source Char) -> (forall r. [Syntax leaf r] -> Aligned (Syntax leaf) r) -> Join These Info -> Syntax leaf (AlignedDiff leaf) -> AlignedDiff leaf
|
||||
alignTermBy sources constructor infos syntax = infos :< constructor [syntax]
|
||||
alignTermBy sources constructor infos syntax = infos :< Aligned (alignSyntax sources (characterRange <$> infos) syntax)
|
||||
|
||||
alignSyntax :: Both (Source Char) -> Join These Range -> Syntax leaf (AlignedDiff leaf) -> Join These [Syntax leaf (AlignedDiff leaf)]
|
||||
alignSyntax sources ranges (Leaf s) = (Leaf s <$) <$> lineRanges
|
||||
|
Loading…
Reference in New Issue
Block a user