mirror of
https://github.com/github/semantic.git
synced 2024-12-21 13:51:44 +03:00
Simplify declaration to accept any node with a Declaration attached.
This commit is contained in:
parent
63482dc151
commit
9eac08919f
@ -73,9 +73,7 @@ data DeclarationType = Method | Function | Class
|
||||
deriving (Eq, Show)
|
||||
|
||||
declaration :: HasField fields (Maybe Declaration) => TermF (Syntax Text) (Record fields) a -> Maybe (Record fields)
|
||||
declaration (annotation :< syntax) | S.Method{} <- syntax = Just annotation
|
||||
| S.Function{} <- syntax = Just annotation
|
||||
| otherwise = Nothing
|
||||
declaration (annotation :< _) = annotation <$ (getField annotation :: Maybe Declaration)
|
||||
|
||||
|
||||
-- | An entry in a table of contents.
|
||||
|
Loading…
Reference in New Issue
Block a user