Safe Haskell | None |
---|---|
Language | Haskell98 |
- isHsFile :: FilePath -> Bool
- isLiterateFile :: FilePath -> Bool
- merge :: Ord a => [a] -> [a] -> [a]
- data TagVal = TagVal !Text !Type
- data Type
- data Tag
- data Pos a = Pos {}
- data SrcPos = SrcPos {}
- newtype UnstrippedTokens = UnstrippedTokens [Token]
- processFile :: FilePath -> Bool -> IO ([Pos TagVal], [String])
- processAll :: [[Pos TagVal]] -> [Pos TagVal]
- process :: FilePath -> Bool -> Text -> ([Pos TagVal], [String])
- stripCpp :: Text -> Text
- stripNewlines :: UnstrippedTokens -> [Token]
- breakBlocks :: UnstrippedTokens -> [UnstrippedTokens]
- unstrippedTokensOf :: UnstrippedTokens -> [Token]
- split :: Eq a => a -> [a] -> [[a]]
Documentation
isLiterateFile :: FilePath -> Bool Source #
newtype UnstrippedTokens Source #
Newlines have to remain in the tokens because breakBlocks
relies on
them. But they make pattern matching on the tokens unreliable because
newlines might be anywhere. A newtype makes sure that the tokens only get
stripped once and that I don't do any pattern matching on unstripped tokens.
processAll :: [[Pos TagVal]] -> [Pos TagVal] Source #
Global processing for when all tags are together.
process :: FilePath -> Bool -> Text -> ([Pos TagVal], [String]) Source #
Process one file's worth of tags.
stripNewlines :: UnstrippedTokens -> [Token] Source #
It's easier to scan for tokens without pesky newlines popping up
everywhere. But I need to keep the newlines in in case I hit a where
and need to call breakBlocks
again.
breakBlocks :: UnstrippedTokens -> [UnstrippedTokens] Source #
Break the input up into blocks based on indentation.
unstrippedTokensOf :: UnstrippedTokens -> [Token] Source #