Skip to content

Commit 17d4ff3

Browse files
committed
Parse psc options that can have module names with dots
1 parent 34f0cd8 commit 17d4ff3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Language/PureScript.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ compile opts ms = do
6363
modify (\s -> s { checkCurrentModule = Just moduleName })
6464
Module moduleName <$> typeCheckAll mainModuleIdent moduleName decls
6565
regrouped <- createBindingGroupsModule . collapseBindingGroupsModule $ elaborated
66-
let entryPoints = (ModuleName . return . ProperName) `map` optionsModules opts
66+
let entryPoints = (ModuleName . splitProperNames) `map` optionsModules opts
6767
let elim = if null entryPoints then regrouped else eliminateDeadCode env entryPoints regrouped
6868
let js = mapMaybe (flip (moduleToJs opts) env) elim
6969
let exts = intercalate "\n" . map (flip moduleToPs env) $ elim
@@ -75,4 +75,8 @@ compile opts ms = do
7575
_ -> return js
7676
return (prettyPrintJS [(wrapExportsContainer opts js')], exts, env)
7777
where
78-
mainModuleIdent = (ModuleName . return . ProperName) <$> optionsMain opts
78+
mainModuleIdent = ModuleName . splitProperNames <$> optionsMain opts
79+
splitProperNames s = case dropWhile (== '.') s of
80+
"" -> []
81+
s' -> ProperName w : splitProperNames s''
82+
where (w, s'') = break (== '.') s'

0 commit comments

Comments
 (0)