auto-extract 0.1.0.0 → 0.1.0.1
raw patch · 4 files changed
+12/−3 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- auto-extract.cabal +1/−1
- src/AutoExtract.hs +6/−2
- test/Main.hs +1/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for auto-extract +## 0.1.0.1 -- 2026-02-03++* Fixed a bug that resulted in needing whitespace before the '('.+ ## 0.1.0.0 -- YYYY-mm-dd * First version. Released on an unsuspecting world.
auto-extract.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: auto-extract-version: 0.1.0.0+version: 0.1.0.1 license: BSD-3-Clause license-file: LICENSE synopsis: Extract code segment to top level function
src/AutoExtract.hs view
@@ -138,10 +138,14 @@ case BS.breakSubstring "EXTRACT@" bs of (before, "") -> if matchFound then Just before else Nothing (before, match) -> do- let name = BS8.takeWhile (not . Char.isSpace) $ BS.drop 8 match+ let spaceOrParen c = Char.isSpace c || c == '('+ name = BS8.takeWhile (not . spaceOrParen) $ BS.drop 8 match guard . not $ BS.null name let rest = BS.drop (8 + BS.length name) match- expr = "EXTRACT \"" <> name <> "\""+ expr = "EXTRACT \"" <> name <> "\"" <>+ case BS8.uncons rest of+ Just ('(', _) -> " " -- Add a space if no separation with the '('+ _ -> "" newRest <- update True rest Just $ before <> expr <> newRest
test/Main.hs view
@@ -26,6 +26,7 @@ #endif , testCase "11" $ runTest "Case11.hs" , testCase "12" $ runTest "Case12.hs"+ , testCase "13" $ runTest "Case13.hs" ] ]