Copyright | (c) 2014 - 2016 Björn Peemöller 2016 Jan Tikovsky 2016 - 2017 Finn Teegen |
---|---|
License | BSD-3-clause |
Maintainer | bjp@informatik.uni-kiel.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module arranges the tokens of the module into different code categories for HTML presentation. The parsed and qualified module is used to establish links between used identifiers and their definitions.
The fully qualified module is traversed to generate a list of code elements. Code elements representing identifiers are distinguished by their kind (type constructor, data constructor, function, (type) variable). They include information about their usage (i.e., declaration, call etc.) and whether the identifier occurs fully qualified in the source code or not. Initially, all identifier codes are fully qualified.
In a next step, the token stream of the given program and the code list are
traversed sequentially (see encodeToks
). The information in the token
stream is used to:
- add code elements for newlines, spaces and pragmas
- update the qualification information of identifiers in the code list.
Synopsis
- data Code
- = Keyword String
- | Space Int
- | NewLine
- | Pragma String
- | TypeCons TypeUsage Bool QualIdent
- | DataCons ConsUsage Bool QualIdent
- | Function FuncUsage Bool QualIdent
- | Identifier IdentUsage Bool QualIdent
- | ModuleName ModuleIdent
- | Commentary String
- | NumberCode String
- | StringCode String
- | CharCode String
- | Symbol String
- data TypeUsage
- data ConsUsage
- data IdentUsage
- data FuncUsage
- genProgram :: Module a -> [(Position, Token)] -> [Code]
- code2string :: Code -> String
- getQualIdent :: Code -> Maybe QualIdent
Documentation
Type of codes which are distinguished for HTML output the boolean flags indicate whether the corresponding identifier occurs qualified in the source module
data IdentUsage Source #
Instances
Show IdentUsage Source # | |
Defined in Html.SyntaxColoring showsPrec :: Int -> IdentUsage -> ShowS # show :: IdentUsage -> String # showList :: [IdentUsage] -> ShowS # |
code2string :: Code -> String Source #