packages feed

hindent 4.0 → 4.1.0

raw patch · 4 files changed

+13/−3 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ HIndent.Styles.JohanTibell: fieldupdate :: t -> FieldUpdate NodeInfo -> Printer ()

Files

hindent.cabal view
@@ -1,5 +1,5 @@ name:                hindent-version:             4.0+version:             4.1.0 synopsis:            Extensible Haskell pretty printer description:         Extensible Haskell pretty printer. Both a library and an executable.                      .
src/HIndent.hs view
@@ -55,7 +55,7 @@                   -- For the time being, assume that all "free-floating" comments come at the beginning.                   -- If they were not at the beginning, they would be after some ast node.                   -- Thus, print them before going for the ast.-                  (do mapM_ (printComment Nothing) cs+                  (do mapM_ (printComment Nothing) (reverse cs)                       pretty ast))     ParseFailed _ e -> Left e 
src/HIndent/Styles/JohanTibell.hs view
@@ -47,6 +47,7 @@            ,Extender exp            ,Extender guardedRhs            ,Extender rhs+           ,Extender fieldupdate            ]         ,styleDefConfig =            defaultConfig {configMaxColumns = 80@@ -289,6 +290,15 @@ isFlat (LeftSection _ e _) = isFlat e isFlat (RightSection _ _ e) = isFlat e isFlat _ = return False++-- | rhs on field update on the same line as lhs.+fieldupdate :: t -> FieldUpdate NodeInfo -> Printer ()+fieldupdate _ e =+  case e of+    FieldUpdate _ n e' -> do pretty n+                             write " = "+                             pretty e'+    _ -> prettyNoExt e  -------------------------------------------------------------------------------- -- Helpers
test/Spec.hs view
@@ -13,7 +13,7 @@ import qualified HIndent  styles :: [FilePath]-styles = ["fundamental", "gibiansky", "chris-done"]+styles = ["fundamental", "gibiansky", "chris-done", "johan-tibell"]  testDir, expectedDir :: String testDir = "tests"