packages feed

anansi 0.4.3 → 0.4.4

raw patch · 3 files changed

+16/−16 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

anansi.cabal view
@@ -1,5 +1,5 @@ name: anansi-version: 0.4.3+version: 0.4.4 license: GPL-3 license-file: license.txt author: John Millikin <jmillikin@gmail.com>, Dirk Laurie <dirk.laurie@gmail.com>@@ -32,7 +32,7 @@ source-repository this   type: bazaar   location: https://john-millikin.com/branches/anansi/0.4/-  tag: anansi_0.4.3+  tag: anansi_0.4.4  library   hs-source-dirs: lib@@ -67,7 +67,7 @@ executable anansi   main-is: Main.hs   hs-source-dirs: lib,src-  ghc-options: -Wall+  ghc-options: -Wall -O2    build-depends:       base >= 4.0 && < 5.0
lib/Anansi.hs view
@@ -71,13 +71,13 @@ -- | -- -- @--- looms = Data.Map.fromList---     [ (\"anansi.debug\", 'loomDebug')---     , (\"anansi.html\", 'loomHTML')---     , (\"anansi.latex\", 'loomLaTeX')---     , (\"anansi.markdown\", 'loomMarkdown')---     , (\"anansi.noweb\", 'loomNoWeb')---     ]+--looms = Data.Map.fromList+--    [ (\"anansi.debug\", 'loomDebug')+--    , (\"anansi.html\", 'loomHTML')+--    , (\"anansi.latex\", 'loomLaTeX')+--    , (\"anansi.markdown\", 'loomMarkdown')+--    , (\"anansi.noweb\", 'loomNoWeb')+--    ] -- @ looms :: Map Text Loom looms = fromList
lib/Anansi/Tangle.hs view
@@ -19,6 +19,7 @@  import           Prelude hiding (FilePath) +import           Control.Monad (when) import qualified Control.Monad.State as S import qualified Control.Monad.RWS as RWS import qualified Data.ByteString.Char8 as ByteString@@ -93,7 +94,8 @@ 			then formatPosition doc path 			else const "\n") 		(_, bytes) <- RWS.evalRWST (mapM_ putContent content) env state-		writeFile' path bytes+		let stripped = ByteString.dropWhile (== '\n') bytes+		writeFile' path stripped  formatPosition :: Document -> FilePath -> Position -> Text formatPosition doc = checkPath where@@ -187,11 +189,9 @@ 	TangleState lastPos indent <- RWS.get 	let expectedPos = Position (positionFile lastPos) (positionLine lastPos + 1) 	RWS.put (TangleState pos indent)-	if pos == expectedPos-		then return ()-		else do-			TangleEnv _ format <- RWS.ask-			RWS.tell (encodeUtf8 (format pos))+	when (pos /= expectedPos) $ do+		TangleEnv _ format <- RWS.ask+		RWS.tell (encodeUtf8 (format pos))  lookupMacro :: Monad m => Text -> Position -> TangleT m [Content] lookupMacro name pos = do