@@ -28,6 +28,7 @@ import qualified Data.Map as M
2828import qualified Text.Parsec as P
2929import qualified Text.Parsec.Pos as P
3030
31+import Language.PureScript.Names
3132import Language.PureScript.Values
3233import Language.PureScript.Types
3334import Language.PureScript.Parser.State
@@ -100,13 +101,16 @@ parseImportDeclaration :: P.Parsec String ParseState Declaration
100101parseImportDeclaration = do
101102 reserved "import"
102103 indented
103− module_ <- P.sepBy1 properName (lexeme $ P.char '.')
104+ segments <- P.sepBy1 properName (lexeme $ P.char '.')
104105 idents <- P.optionMaybe $ do
105106 lexeme $ indented *> P.char '('
106107 idents <- P.sepBy1 parseIdent (lexeme $ indented *> P.char ',')
107108 lexeme $ indented *> P.char ')'
108109 return idents
109− return $ ImportDeclaration module_ idents
110+ let modulePath = (mkModulePath (ModulePath [head segments]) (tail segments))
111+ return $ ImportDeclaration modulePath idents
112+ where mkModulePath path (s:ss) = mkModulePath (subModule path s) ss
113+ mkModulePath path _ = path
110114
111115parseDeclaration :: P.Parsec String ParseState Declaration
112116parseDeclaration = P.choice