Commit 83c8b2e3 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Fixed bug in output of FlatCurry interfaces

parent 2b8e9fad
......@@ -518,19 +518,28 @@ isExportedQualIdent qident ((CS.ExportModule _):exps)
--
qualifyIDecl :: ModuleIdent -> CS.IDecl -> CS.IDecl
qualifyIDecl mident (CS.IInfixDecl pos fixi prec qident)
= (CS.IInfixDecl pos fixi prec (qualQualify mident qident))
qualifyIDecl mident (CS.IDataDecl pos qident idents cdecls)
= (CS.IDataDecl pos (qualQualify mident qident) idents cdecls)
qualifyIDecl mident (CS.INewtypeDecl pos qident idents ncdecl)
= (CS.INewtypeDecl pos (qualQualify mident qident) idents ncdecl)
qualifyIDecl mident (CS.ITypeDecl pos qident idents texpr)
= (CS.ITypeDecl pos (qualQualify mident qident) idents texpr)
qualifyIDecl mident (CS.IFunctionDecl pos qident arity texpr)
= (CS.IFunctionDecl pos (qualQualify mident qident) arity (qualifyCSType texpr))
where qualifyCSType = fromType . toQualType mident []
qualifyIDecl mid (CS.IInfixDecl pos fixi prec qid)
= CS.IInfixDecl pos fixi prec (qualQualify mid qid)
qualifyIDecl mid (CS.IDataDecl pos qid vs cs)
= CS.IDataDecl pos (qualQualify mid qid) vs
$ map (fmap (qualifyIConstrDecl mid)) cs
qualifyIDecl mid (CS.INewtypeDecl pos qid vs nc)
= CS.INewtypeDecl pos (qualQualify mid qid) vs nc
qualifyIDecl mid (CS.ITypeDecl pos qid vs ty)
= CS.ITypeDecl pos (qualQualify mid qid) vs ty
qualifyIDecl mid (CS.IFunctionDecl pos qid arity ty)
= CS.IFunctionDecl pos (qualQualify mid qid) arity (qualifyCSType mid ty)
qualifyIDecl _ idecl = idecl
qualifyIConstrDecl :: ModuleIdent -> CS.ConstrDecl -> CS.ConstrDecl
qualifyIConstrDecl mid (CS.ConstrDecl pos vs cid tys)
= CS.ConstrDecl pos vs cid (map (qualifyCSType mid) tys)
qualifyIConstrDecl mid (CS.ConOpDecl pos vs ty1 op ty2)
= CS.ConOpDecl pos vs (qualifyCSType mid ty1) op (qualifyCSType mid ty2)
qualifyCSType :: ModuleIdent -> CS.TypeExpr -> CS.TypeExpr
qualifyCSType mid = fromType . toQualType mid []
--
typeArity :: IL.Type -> Int
......
......@@ -272,7 +272,7 @@ writeFlat :: Options -> FilePath -> CompilerEnv -> ModuleSummary -> IL.Module
writeFlat opts fn env modSum il = do
when (extTarget || fcyTarget) $ do
writeFlatCurry opts fn env modSum il
writeFlatIntf opts fn env modSum il
writeFlatIntf opts fn env modSum il
when (xmlTarget) $ writeFlatXml opts fn modSum il
where
extTarget = ExtendedFlatCurry `elem` optTargetTypes opts
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment