fortran-src-0.4.2: Parsers and analyses for Fortran standards 66, 77, 90 and 95.
Safe HaskellNone
LanguageHaskell2010

Language.Fortran.PrettyPrint

Synopsis

Documentation

(<?>) :: Doc -> Doc -> Doc infixl 7 Source #

(<?+>) :: Doc -> Doc -> Doc infixl 7 Source #

class IndentablePretty t where Source #

Instances

Instances details
Pretty a => IndentablePretty a Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty [Block a] Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty [ProgramUnit a] Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty a => IndentablePretty (Maybe a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty (UnionMap a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty (StructureItem a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty (Block a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty (ProgramUnit a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

IndentablePretty (ProgramFile a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

class Pretty t where Source #

Methods

pprint' :: FortranVersion -> t -> Doc Source #

Instances

Instances details
Pretty String Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty BinaryOp Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty UnaryOp Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty Intent Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty Only Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty CharacterLen Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty BaseType Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty a => Pretty (Maybe a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (DimensionDeclarator a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Declarator a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Value a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Index a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Expression a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (DoSpecification a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (FlushSpec a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (FormatItem a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (DataGroup a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Namelist a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (CommonGroup a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (ImpElement a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (ImpList a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (AllocOpt a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (ControlPair a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Attribute a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Argument a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Use a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Methods

pprint' :: FortranVersion -> Use a -> Doc Source #

Pretty (ProcInterface a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (ProcDecl a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Statement a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Suffix a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (Selector a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (TypeSpec a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Pretty (e a) => Pretty (AList e a) Source # 
Instance details

Defined in Language.Fortran.PrettyPrint

Methods

pprint' :: FortranVersion -> AList e a -> Doc Source #

data ReformatState Source #

Constructors

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.

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!

Orphan instances