Commit 9c11b925 authored by Michael Hanus's avatar Michael Hanus
Browse files

Bug fix for currpp w.r.t. DET annotation translation

parent 44af7fc6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--- is supported (option `foreigncode`, see module `Translator`). --- is supported (option `foreigncode`, see module `Translator`).
--- ---
--- @author Michael Hanus --- @author Michael Hanus
--- @version June 2016 --- @version September 2016
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
import AbstractCurry.Types import AbstractCurry.Types
...@@ -229,14 +229,15 @@ callPreprocessors opts optlines modname srcprog orgfile ...@@ -229,14 +229,15 @@ callPreprocessors opts optlines modname srcprog orgfile
-- untyped Curry but Contracts requires typed Curry: -- untyped Curry but Contracts requires typed Curry:
mbdefprog <- readUntypedCurry modname >>= mbdefprog <- readUntypedCurry modname >>=
transDefaultRules verb defopts srcprog transDefaultRules verb defopts srcprog
let newsrcprog = maybe srcprog showCProg mbdefprog
if Contracts `elem` pptargets if Contracts `elem` pptargets
then do then do
maybe done maybe done
(\defprog -> writeFile orgfile (optlines ++ showCProg defprog)) (\defprog -> writeFile orgfile (optlines ++ showCProg defprog))
mbdefprog mbdefprog
readCurry modname >>= transContracts verb contopts srcprog readCurry modname >>= transContracts verb contopts srcprog
>>= return . maybe srcprog showCProg >>= return . maybe newsrcprog showCProg
else return (maybe srcprog showCProg mbdefprog) else return newsrcprog
| Contracts `elem` pptargets | Contracts `elem` pptargets
= readCurry modname >>= transContracts verb contopts srcprog = readCurry modname >>= transContracts verb contopts srcprog
>>= return . maybe srcprog showCProg >>= return . maybe srcprog showCProg
......
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