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

Define a type for declarations.

This commit is contained in:
Rob Rix 2017-05-10 11:57:28 -04:00
parent 40d8a7ac5c
commit fdcf96cd4c

View File

@ -5,6 +5,8 @@ module Renderer.TOC
, JSONSummary(..) , JSONSummary(..)
, Summarizable(..) , Summarizable(..)
, isErrorSummary , isErrorSummary
, Declaration(..)
, DeclarationType(..)
, Entry(..) , Entry(..)
, tableOfContentsBy , tableOfContentsBy
) where ) where
@ -61,6 +63,14 @@ data Summarizable
} }
deriving (Eq, Show) deriving (Eq, Show)
-- | A declarations identifier and type.
data Declaration = Declaration { declarationIdentifier :: Text, declarationType :: DeclarationType }
deriving (Eq, Show)
-- | The type of a declaration.
data DeclarationType = Method | Function | Class
deriving (Eq, Show)
-- | An entry in a table of contents. -- | An entry in a table of contents.
data Entry a data Entry a
= Unchanged a -- ^ An entry for an unchanged portion of a diff (i.e. a diff node not containing any patches). = Unchanged a -- ^ An entry for an unchanged portion of a diff (i.e. a diff node not containing any patches).