1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00

Parameterize ALaCarteTerm by the symbols to summarize.

This commit is contained in:
Rob Rix 2019-10-01 12:10:38 -04:00
parent 7259059b51
commit f092a3017c
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -70,7 +70,7 @@ parseSymbols blobs = do
| Precise <- pythonMode modes
, Python <- blobLanguage'
= catching $ renderToSymbols <$> parse precisePythonParser blob
| otherwise = catching $ withSomeTerm (renderToSymbols . ALaCarteTerm (blobLanguage blob)) <$> doParse blob
| otherwise = catching $ withSomeTerm (renderToSymbols . ALaCarteTerm (blobLanguage blob) symbolsToSummarize) <$> doParse blob
where
catching m = m `catchError` (\(SomeException e) -> pure $ errorFile (show e))
blobLanguage' = blobLanguage blob
@ -96,7 +96,7 @@ tagToSymbol Tag{..} = Symbol
}
data ALaCarteTerm syntax ann = ALaCarteTerm Language (Term syntax ann)
data ALaCarteTerm syntax ann = ALaCarteTerm Language [Text] (Term syntax ann)
instance IsTaggable syntax => Precise.ToTags (ALaCarteTerm syntax) where
tags source (ALaCarteTerm lang term) = runTagging lang source symbolsToSummarize term
tags source (ALaCarteTerm lang symbolsToSummarize term) = runTagging lang source symbolsToSummarize term