1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Methods are identifiable.

This commit is contained in:
Rob Rix 2017-04-24 13:41:20 -04:00
parent 54108f0019
commit d3517ab60f

View File

@ -113,4 +113,5 @@ optional a = a <|> term <*> pure Syntax.Empty
identifiable :: Term Syntax a -> [Term Syntax a]
identifiable = para $ \ c@(_ :< union) -> case union of
_ | Just Declaration.Class{} <- prj union -> cofree (fmap fst c) : foldMap snd union
_ | Just Declaration.Method{} <- prj union -> cofree (fmap fst c) : foldMap snd union
_ -> foldMap snd union