@@ -28,6 +28,7 @@ import qualified Data.Map as M
28import qualified Text.Parsec as P
28import qualified Text.Parsec as P
29import qualified Text.Parsec.Pos as P
29import qualified Text.Parsec.Pos as P
31+import Language.PureScript.Names
31import Language.PureScript.Values
32import Language.PureScript.Values
32import Language.PureScript.Types
33import Language.PureScript.Types
33import Language.PureScript.Parser.State
34import Language.PureScript.Parser.State
@@ -100,13 +101,16 @@ parseImportDeclaration :: P.Parsec String ParseState Declaration
100parseImportDeclaration = do
101parseImportDeclaration = do
101 reserved "import"
102 reserved "import"
103− module_ <- P.sepBy1 properName (lexeme $ P.char '.')
104+ segments <- P.sepBy1 properName (lexeme $ P.char '.')
104 idents <- P.optionMaybe $ do
105 idents <- P.optionMaybe $ do
105 lexeme $ indented *> P.char '('
106 lexeme $ indented *> P.char '('
106 idents <- P.sepBy1 parseIdent (lexeme $ indented *> P.char ',')
107 idents <- P.sepBy1 parseIdent (lexeme $ indented *> P.char ',')
107 lexeme $ indented *> P.char ')'
108 lexeme $ indented *> P.char ')'
108 return idents
109 return idents
110+ let modulePath = (mkModulePath (ModulePath [head segments]) (tail segments))
109− return $ ImportDeclaration module_ idents
111+ return $ ImportDeclaration modulePath idents
112+ where mkModulePath path (s:ss) = mkModulePath (subModule path s) ss
113+ mkModulePath path _ = path
111parseDeclaration :: P.Parsec String ParseState Declaration
115parseDeclaration :: P.Parsec String ParseState Declaration
112parseDeclaration = P.choice
116parseDeclaration = P.choice