1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Use record syntax to update info.

This commit is contained in:
Rob Rix 2016-04-14 19:40:49 -04:00
parent e5dd029b10
commit 3e1072f714

View File

@ -133,7 +133,7 @@ alignSyntax toJoinThese sources infos syntax = case syntax of
Fixed children -> catMaybes $ wrapInBranch Fixed <$> groupChildrenByLine lineRanges children
_ -> []
where lineRanges = toJoinThese $ actualLineRanges <$> (characterRange <$> infos) <*> sources
wrapInBranch constructor = applyThese $ toJoinThese ((\ info (range, children) -> Free (Annotated (setCharacterRange info range) (constructor children))) <$> infos)
wrapInBranch constructor = applyThese $ toJoinThese ((\ info (range, children) -> Free (Annotated (info { characterRange = range }) (constructor children))) <$> infos)
groupChildrenByLine :: Join These [Range] -> [AlignedDiff leaf] -> [Join These (Range, [SplitDiff leaf Info])]
groupChildrenByLine ranges children | not (and $ null <$> ranges)