Module Ninja.Pretty

Module to pretty print Ninja build files

Author: Marc Andre Wittorf

Version: 0.1

Summary of exported operations:

renderNinja :: File -> String   
Render a Ninja file to a string representation
ppFile :: File -> Doc   
Render a Ninja file to a Pretty-Doc
ppDecl :: Decl -> Doc   
Render a Ninja declaration
ppDef :: (String,String) -> Doc   
Render a defintion
ppDefs :: [(String,String)] -> Doc   
Render definitions
ppTargets :: [String] -> Doc   
Render explicit targets
ppImplicitTargets :: [String] -> Doc   
Render implicit targets
ppOrderOnlyTargets :: [String] -> Doc   
Render order-only targets

Exported operations:

renderNinja :: File -> String   

Render a Ninja file to a string representation

Example call:
(renderNinja file)
Parameters:
  • file : the abstract Ninja file representation
Returns:
the rendered Ninja file

ppFile :: File -> Doc   

Render a Ninja file to a Pretty-Doc

Example call:
(ppFile file)
Parameters:
  • file : the abstract Ninja file representation
Returns:
the rendered Ninja file

ppDecl :: Decl -> Doc   

Render a Ninja declaration

Example call:
(ppDecl decl the)
Parameters:
  • decl : a Ninja declaration
  • the : rendered Ninja declaration

ppDef :: (String,String) -> Doc   

Render a defintion

Example call:
(ppDef def)
Parameters:
  • def : the definition
Returns:
the rendered definition

ppDefs :: [(String,String)] -> Doc   

Render definitions

Example call:
(ppDefs defs)
Parameters:
  • defs : the definitions
Returns:
the rendered definitions

ppTargets :: [String] -> Doc   

Render explicit targets

Example call:
(ppTargets tgts)
Parameters:
  • tgts : the targets
Returns:
the rendered targets

ppImplicitTargets :: [String] -> Doc   

Render implicit targets

Example call:
(ppImplicitTargets tgts)
Parameters:
  • tgts : the targets
Returns:
the rendered targets

ppOrderOnlyTargets :: [String] -> Doc   

Render order-only targets

Example call:
(ppOrderOnlyTargets tgts)
Parameters:
  • tgts : the targets
Returns:
the rendered targets