Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tooOld :: FortranVersion -> String -> FortranVersion -> a
- (<?>) :: Doc -> Doc -> Doc
- (<?+>) :: Doc -> Doc -> Doc
- newline :: Doc
- type Indentation = Maybe Int
- incIndentation :: Indentation -> Indentation
- indent :: Indentation -> Doc -> Doc
- overlay :: Doc -> Doc -> Doc
- fixedForm :: Indentation
- pprintAndRender :: IndentablePretty t => FortranVersion -> t -> Indentation -> String
- class IndentablePretty t where
- pprint :: FortranVersion -> t -> Indentation -> Doc
- endGen :: Pretty a => FortranVersion -> Doc -> a -> Indentation -> Doc
- class Pretty t where
- pprint' :: FortranVersion -> t -> Doc
- commaSep :: [Doc] -> Doc
- data ReformatState
- reformatMixedFormInsertContinuations :: String -> String
Documentation
tooOld :: FortranVersion -> String -> FortranVersion -> a Source #
type Indentation = Maybe Int Source #
pprintAndRender :: IndentablePretty t => FortranVersion -> t -> Indentation -> String Source #
class IndentablePretty t where Source #
pprint :: FortranVersion -> t -> Indentation -> Doc Source #
Instances
endGen :: Pretty a => FortranVersion -> Doc -> a -> Indentation -> Doc Source #
pprint' :: FortranVersion -> t -> Doc Source #
Instances
data ReformatState Source #
RefmtStNewline Int | Unsure yet whether current line it's a comment or statement. |
RefmtStComment | Current line is a comment; no need to track column number. |
RefmtStStmt Int | Current line is a statement. |
Instances
Eq ReformatState Source # | |
Defined in Language.Fortran.PrettyPrint (==) :: ReformatState -> ReformatState -> Bool # (/=) :: ReformatState -> ReformatState -> Bool # | |
Ord ReformatState Source # | |
Defined in Language.Fortran.PrettyPrint compare :: ReformatState -> ReformatState -> Ordering # (<) :: ReformatState -> ReformatState -> Bool # (<=) :: ReformatState -> ReformatState -> Bool # (>) :: ReformatState -> ReformatState -> Bool # (>=) :: ReformatState -> ReformatState -> Bool # max :: ReformatState -> ReformatState -> ReformatState # min :: ReformatState -> ReformatState -> ReformatState # | |
Show ReformatState Source # | |
Defined in Language.Fortran.PrettyPrint showsPrec :: Int -> ReformatState -> ShowS # show :: ReformatState -> String # showList :: [ReformatState] -> ShowS # |
reformatMixedFormInsertContinuations :: String -> String Source #
Add continuations where required to a pretty-printed program.
Ensures that no non-comment line exceeds 72 columns.
The reformatting should be compatible with fixed and free-form Fortran standards. See: http://fortranwiki.org/fortran/show/Continuation+lines
This is a simple, delicate algorithm that must only be used on pretty printer output, due to relying on particular parser & pretty printer behaviour. In particular, comments not beginning a line (e.g. after a statement or continuation) won't be picked up as a comment, so could wreck that line. Be warned if you're using it on piles of funky-looking code!