Commit 5f895d0b authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Resolved bug of type constructor renaming

parent da1c1277
...@@ -38,7 +38,7 @@ data CompilerEnv = CompilerEnv ...@@ -38,7 +38,7 @@ data CompilerEnv = CompilerEnv
, opPrecEnv :: PEnv -- ^ operator precedences , opPrecEnv :: PEnv -- ^ operator precedences
, tyConsEnv :: TCEnv -- ^ type constructors , tyConsEnv :: TCEnv -- ^ type constructors
, valueEnv :: ValueEnv -- ^ functions and data constructors , valueEnv :: ValueEnv -- ^ functions and data constructors
} } deriving Show
initCompilerEnv :: ModuleIdent -> CompilerEnv initCompilerEnv :: ModuleIdent -> CompilerEnv
initCompilerEnv mid = CompilerEnv initCompilerEnv mid = CompilerEnv
......
...@@ -97,7 +97,7 @@ code are obsolete and commented out. ...@@ -97,7 +97,7 @@ code are obsolete and commented out.
> -- generate target code > -- generate target code
> let intf = exportInterface env modul > let intf = exportInterface env modul
> let modSum = summarizeModule (tyConsEnv env2) intf modul > let modSum = summarizeModule (tyConsEnv env2) intf modul
> writeFlat opts fn env2 modSum il > writeFlat opts fn (qualifyEnv opts env2) modSum il
> where > where
> withFlat = any (`elem` optTargetTypes opts) > withFlat = any (`elem` optTargetTypes opts)
> [FlatCurry, FlatXml, ExtendedFlatCurry] > [FlatCurry, FlatXml, ExtendedFlatCurry]
...@@ -176,18 +176,16 @@ Haskell and original MCC where a module obtains \texttt{main}). ...@@ -176,18 +176,16 @@ Haskell and original MCC where a module obtains \texttt{main}).
-- --------------------------------------------------------------------------- -- ---------------------------------------------------------------------------
> checkModule :: Options -> CompilerEnv -> CS.Module -> (CompilerEnv, CS.Module) > checkModule :: Options -> CompilerEnv -> CS.Module -> (CompilerEnv, CS.Module)
> checkModule opts env mdl = qualifyEnvs > checkModule opts env mdl = expand
> $ expand
> $ uncurry qual > $ uncurry qual
> $ (if withFlat then uncurry typeCheck else id) > $ (if withFlat then uncurry typeCheck else id)
> $ uncurry precCheck > $ uncurry precCheck
> $ uncurry (syntaxCheck opts) > $ uncurry (syntaxCheck opts)
> $ kindCheck env mdl > $ kindCheck env mdl
> where > where
> expand (e, m) = if withFlat then (e, expandInterface e m) else (e, m) > expand (e, m) = if withFlat then (e, expandInterface e m) else (e, m)
> qualifyEnvs (e, m) = (qualifyEnv opts e, m) > withFlat = any (`elem` optTargetTypes opts)
> withFlat = any (`elem` optTargetTypes opts) > [FlatCurry, FlatXml, ExtendedFlatCurry]
> [FlatCurry, FlatXml, ExtendedFlatCurry]
-- --------------------------------------------------------------------------- -- ---------------------------------------------------------------------------
-- Translating a module -- Translating a module
......
Supports Markdown
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