1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 06:46:07 +03:00

Bind a variable for the effective language.

This commit is contained in:
Rob Rix 2017-05-31 10:59:31 -04:00
parent e5558c32a4
commit fb587a759a

View File

@ -60,8 +60,8 @@ parseDiffAndRenderBlobPair renderer blobs = case renderer of
term <- parseSource blob
decorate (declarationAlgebra (source blob)) term
diffAndRenderTermPair blobs (runBothWith diffTerms) Prologue.snd terms
where languages = blobLanguage <$> blobs
parseSource = parse (parserForLanguage (runBothWith (<|>) languages)) . source
where effectiveLanguage = runBothWith (<|>) (blobLanguage <$> blobs)
parseSource = parse (parserForLanguage effectiveLanguage) . source
-- | A task to diff a pair of 'Term's and render the 'Diff', producing insertion/deletion 'Patch'es for non-existent 'SourceBlob's.
diffAndRenderTermPair :: Functor f => Both SourceBlob -> Differ f a -> ((Both SourceBlob, Diff f a) -> output) -> Both (Term f a) -> Task (Maybe output)