diff options
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Namespace.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Biz/Namespace.hs b/Biz/Namespace.hs index f0e3b32..8cc6b5c 100644 --- a/Biz/Namespace.hs +++ b/Biz/Namespace.hs @@ -86,6 +86,7 @@ fromHaskellContent c = case Regex.findFirstInfix haskellModule c of </ (Regex.string "\nmodule " *> Regex.many (name <|> dot)) <*> pure Hs +toModule :: Namespace -> String toModule (Namespace parts Hs) = joinWith "." parts toModule (Namespace parts Py) = joinWith "." parts toModule (Namespace parts Scm) = "(" ++ joinWith " " parts ++ ")" @@ -106,7 +107,7 @@ dot = Regex.some <| Regex.sym '.' name :: Regex.RE Char String name = Regex.many (Regex.psym Char.isUpper) - <> Regex.many (Regex.psym Char.isAlphaNum) + <> Regex.many (Regex.psym (\c -> Char.isAlphaNum c || (c == '_'))) rePath :: Regex.RE Char [String] rePath = Regex.many (name <* Regex.string "/" <|> name) @@ -130,4 +131,4 @@ reExt = -- inputs. isCab :: FilePath -> Bool isCab ('_' : _) = True -isCab fp = "_" `List.isInfixOf` fp +isCab fp = "/_/" `List.isInfixOf` fp |