packages feed

dhscanner-kbgen 1.0.7 → 1.0.8

raw patch · 2 files changed

+13/−2 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

dhscanner-kbgen.cabal view
@@ -33,7 +33,7 @@         * explain in plain English your query's purpose
         * et voilà !
 
-version:            1.0.7
+version:            1.0.8
 license:            GPL-3.0-only
 license-file:       LICENSE
 author:             OrenGitHub
src/Kbgen.hs view
@@ -582,11 +582,22 @@ prologify_ParamiOfCallable :: ParamiOfCallable -> String
 prologify_ParamiOfCallable (ParamiOfCallable (Param p) (ParamIndex i) (Callable c)) = prologify_ParamiOfCallable' p i c
 
+normalizeChar :: Char -> String
+normalizeChar '/' = "_slash_"
+normalizeChar '.' = "_dot_"
+normalizeChar '-' = "_dash_"
+normalizeChar '['  = "_lbrack_"
+normalizeChar ']'  = "_rbrack_"
+normalizeChar c = [c]
+
+normalize :: FilePath -> FilePath
+normalize path = concatMap normalizeChar path
+
 locationify :: Location -> String
 locationify l = let
     x = Location.lineStart l
     y = Location.colStart l
     z = Location.lineEnd l
     w = Location.colEnd l
-    f = Location.filename l
+    f = normalize (Location.filename l)
     in printf "startloc_%u_%u_endloc_%u_%u_%s" x y z w f