packages feed

bash 0.1.5 → 0.1.6

raw patch · 2 files changed

+23/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Language.Bash.PrettyPrinter: isAndAnd :: Annotated t -> Bool
+ Language.Bash.PrettyPrinter: isOrOr :: Annotated t -> Bool
+ Language.Bash.PrettyPrinter: isPipe :: Annotated t -> Bool
+ Language.Bash.PrettyPrinter: isSimple :: Annotated t -> Bool

Files

Language/Bash/PrettyPrinter.hs view
@@ -91,10 +91,16 @@     NoOp msg | null msg     ->  word ":"              | otherwise    ->  word ":" >> (word . Esc.bytes . Esc.bash) msg     Bang t                  ->  hangWord "!" >> binGrp t >> outdent-    AndAnd t t'             ->  binGrp t >> word "&&" >> nl >> binGrp t'-    OrOr t t'               ->  binGrp t >> word "||" >> nl >> binGrp t'-    Pipe t t'               ->  binGrp t >> word "|"  >> nl >> binGrp t'-    Sequence t t'           ->  pp t          >> nl        >> pp t'+    AndAnd t t'             ->  if isSimple t && (isSimple t' || isAndAnd t')+                                then pp t     >> word "&&" >> nl >> pp t'+                                else binGrp t >> word "&&" >> nl >> binGrp t'+    OrOr t t'               ->  if isSimple t && (isSimple t' || isOrOr t')+                                then pp t     >> word "||" >> nl >> pp t'+                                else binGrp t >> word "||" >> nl >> binGrp t'+    Pipe t t'               ->  if isSimple t && (isSimple t' || isPipe t')+                                then pp t     >> word "|"  >> nl >> pp t'+                                else binGrp t >> word "|"  >> nl >> binGrp t'+    Sequence t t'           ->  pp t     >> nl        >> pp t'     Background t t'         ->  binGrp t >> word "&"  >> nl >> pp t'     Group t                 ->  curlyOpen >> pp t     >> curlyClose >> outdent     Subshell t              ->  roundOpen >> pp t     >> roundClose >> outdent@@ -176,6 +182,18 @@ trimPrinter LongestLeading   =  "##" trimPrinter ShortestTrailing =  "%" trimPrinter LongestTrailing  =  "%%"++isSimple (Annotated _ (SimpleCommand _ _)) = True+isSimple _                                 = False++isAndAnd (Annotated _ (AndAnd _ _)) = True+isAndAnd _                          = False++isOrOr (Annotated _ (OrOr _ _)) = True+isOrOr _                        = False++isPipe (Annotated _ (Pipe _ _)) = True+isPipe _                        = False  binGrp a@(Annotated _ stmt)  =  case stmt of   Bang _                    ->  curlyOpen >> pp a >> curlyClose
bash.cabal view
@@ -1,5 +1,5 @@ name                          : bash-version                       : 0.1.5+version                       : 0.1.6 category                      : Language license                       : BSD3 license-file                  : LICENSE