mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Parameterize ALaCarteTerm by the symbols to summarize.
This commit is contained in:
parent
7259059b51
commit
f092a3017c
@ -70,7 +70,7 @@ parseSymbols blobs = do
|
|||||||
| Precise <- pythonMode modes
|
| Precise <- pythonMode modes
|
||||||
, Python <- blobLanguage'
|
, Python <- blobLanguage'
|
||||||
= catching $ renderToSymbols <$> parse precisePythonParser blob
|
= 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
|
where
|
||||||
catching m = m `catchError` (\(SomeException e) -> pure $ errorFile (show e))
|
catching m = m `catchError` (\(SomeException e) -> pure $ errorFile (show e))
|
||||||
blobLanguage' = blobLanguage blob
|
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
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user