@@ -99,10 +99,20 @@ parseImportDeclaration :: P.Parsec String ParseState Declaration
9999parseImportDeclaration = do
100100 reserved "import"
101101 indented
102− moduleName' <- moduleName
103− idents <- P.optionMaybe $ parens $ commaSep parseDeclarationRef
104− asQ <- P.optionMaybe $ reserved "as" *> moduleName
105− return $ ImportDeclaration moduleName' idents asQ
102+ qualImport <|> stdImport
103+ where
104+ stdImport = do
105+ moduleName' <- moduleName
106+ idents <- P.optionMaybe $ parens $ commaSep parseDeclarationRef
107+ return $ ImportDeclaration moduleName' idents Nothing
108+ qualImport = do
109+ reserved "qualified"
110+ indented
111+ moduleName' <- moduleName
112+ idents <- P.optionMaybe $ parens $ commaSep parseDeclarationRef
113+ reserved "as"
114+ asQ <- moduleName
115+ return $ ImportDeclaration moduleName' idents (Just asQ)
106116
107117parseDeclarationRef :: P.Parsec String ParseState DeclarationRef
108118parseDeclarationRef = ValueRef <$> parseIdent