Commit b463ff65 authored by Michael Hanus's avatar Michael Hanus
Browse files

Adapt to flatcurry-type-annotated

parent a02270a0
{
"name": "html2",
"version": "3.0.0",
"version": "3.3.0",
"author": "Michael Hanus <mh@informatik.uni-kiel.de>",
"synopsis": "Libraries for HTML programming with event-handler-based form processing",
"category": [ "Web" ],
"dependencies": {
"base" : ">= 3.0.0, < 4.0.0",
"abstract-curry" : ">= 3.0.0, < 4.0.0",
"cryptohash" : ">= 3.0.0, < 4.0.0",
"currypath" : ">= 3.0.0, < 4.0.0",
"directory" : ">= 3.0.0, < 4.0.0",
"filepath" : ">= 3.0.0, < 4.0.0",
"flatcurry" : ">= 3.0.0, < 4.0.0",
"flatcurry-annotated": ">= 3.0.0, < 4.0.0",
"global" : ">= 3.0.0, < 4.0.0",
"io-extra" : ">= 3.0.0, < 4.0.0",
"process" : ">= 3.0.0, < 4.0.0",
"random" : ">= 3.0.0, < 4.0.0"
"base" : ">= 3.0.0, < 4.0.0",
"abstract-curry" : ">= 3.0.0, < 4.0.0",
"cryptohash" : ">= 3.0.0, < 4.0.0",
"currypath" : ">= 3.0.0, < 4.0.0",
"directory" : ">= 3.0.0, < 4.0.0",
"filepath" : ">= 3.0.0, < 4.0.0",
"flatcurry" : ">= 3.0.0, < 4.0.0",
"flatcurry-annotated" : ">= 3.3.0, < 4.0.0",
"flatcurry-type-annotated": ">= 3.3.0, < 4.0.0",
"global" : ">= 3.0.0, < 4.0.0",
"io-extra" : ">= 3.0.0, < 4.0.0",
"process" : ">= 3.0.0, < 4.0.0",
"random" : ">= 3.0.0, < 4.0.0"
},
"compilerCompatibility": {
"pakcs": ">= 3.0.0, < 3.3.0"
"pakcs": ">= 3.3.0, < 4.0.0",
"kics2": ">= 3.0.0, < 4.0.0"
},
"sourceDirs": [ "src", "scripts" ],
"exportedModules": [ "HTML.Base",
......
......@@ -25,7 +25,7 @@ banner :: String
banner = unlines [bannerLine,bannerText,bannerLine]
where
bannerText = "Compile Curry programs with HTML forms to CGI executables " ++
"(Version of 07/10/20)"
"(Version of 17/12/20)"
bannerLine = take (length bannerText) (repeat '=')
------------------------------------------------------------------------------
......
......@@ -3,7 +3,7 @@
--- in all form definitions.
---
--- @author Michael Hanus
--- @version August 2020
--- @version December 2020
------------------------------------------------------------------------------
module C2C.TransTypedFlatCurryForms
......@@ -14,8 +14,8 @@ import Control.Monad ( when, unless )
import System.FilePath ( (</>), (<.>) )
import System.Process ( exitWith, system )
import FlatCurry.Annotated.Files
import FlatCurry.Annotated.Types
import FlatCurry.TypeAnnotated.Files
import System.CurryPath ( lookupModuleSourceInLoadPath )
import C2C.Options
......@@ -30,13 +30,14 @@ setFormIDsInTypedFlatCurry opts mname = do
where
attachFormIDsInProg (mdir,_) = do
when (optVerb opts > 1) $ putStr $
"Reading TypedFlatCurry of module '" ++ mname ++ "'..."
(AProg name imps types funcs ops) <- readTypedFlatCurry mname
"Reading TypeAnnotatedFlatCurry of module '" ++ mname ++ "'..."
(AProg name imps types funcs ops) <- readTypeAnnotatedFlatCurry mname
putStrLnInter opts "done!"
let newflatname = typedFlatCurryFileName (mdir </> mname) ++ transSuffix
let newflatname = typeAnnotatedFlatCurryFileName (mdir </> mname) ++
transSuffix
tprog = AProg name imps types (map transFunc funcs) ops
putStrLnInter opts $ "Writing transformed FlatCurry file..."
writeTypedFlatCurryFile newflatname tprog
writeTypeAnnotatedFlatCurryFile newflatname tprog
copyFlatCurryInDir opts mdir mname
transFunc fd@(AFunc fn ar vis te rl) =
......@@ -71,7 +72,7 @@ charType = TCons ("Prelude","Char") []
stringType :: TypeExpr
stringType = TCons ("Prelude","[]") [charType]
--- Copies transformed TypedFlatCurry files.
--- Copies transformed TypeAnnotatedFlatCurry files.
copyTransTypedFlatCurry :: Options -> String -> IO ()
copyTransTypedFlatCurry opts mname = do
lookupModuleSourceInLoadPath mname >>=
......@@ -80,9 +81,10 @@ copyTransTypedFlatCurry opts mname = do
copyFlatCurryInDir :: Options -> String -> String -> IO ()
copyFlatCurryInDir opts mdir mname = do
let flatname = typedFlatCurryFileName (mdir </> mname)
newflatname = typedFlatCurryFileName (mdir </> mname) ++ transSuffix
putStrLnInter opts $ "Replacing original TypedFlatCurry file..."
let flatname = typeAnnotatedFlatCurryFileName (mdir </> mname)
newflatname = typeAnnotatedFlatCurryFileName (mdir </> mname) ++
transSuffix
putStrLnInter opts $ "Replacing original TypeAnnotatedFlatCurry file..."
cprc <- execVerbCommand opts $
"/bin/cp \"" ++ newflatname ++ "\" \"" ++ flatname ++ "\""
-- delete existing Haskell target files for this module:
......
......@@ -5,7 +5,7 @@
--- for executing cgi scripts.
---
--- @author Michael Hanus
--- @version November 2020
--- @version December 2020
------------------------------------------------------------------------------
module Curry2CGI ( main )
......@@ -22,13 +22,13 @@ import System.FilePath ( (</>), isRelative, takeDirectory )
import System.IOExts ( evalCmd )
import System.Process ( getPID, exitWith, system )
import FlatCurry.Files ( readFlatCurry )
import FlatCurry.Annotated.Files ( readTypedFlatCurry )
import FlatCurry.Files ( readFlatCurry )
import FlatCurry.TypeAnnotated.Files ( readTypeAnnotatedFlatCurry )
import C2C.Options
import C2C.ExtractForms ( extractFormsInProg )
import C2C.TransFlatCurryForms ( copyTransFlatCurry )
import C2C.TransTypedFlatCurryForms ( copyTransTypedFlatCurry )
import C2C.ExtractForms ( extractFormsInProg )
import C2C.TransFlatCurryForms ( copyTransFlatCurry )
import C2C.TransTypedFlatCurryForms ( copyTransTypedFlatCurry )
------------------------------------------------------------------------
......@@ -105,7 +105,7 @@ compileCGI opts transmods mname = do
case optSysName opts of
"pakcs" -> do readFlatCurry mainmod
mapM_ (copyTransFlatCurry opts) transmods
"kics2" -> do readTypedFlatCurry mainmod
"kics2" -> do readTypeAnnotatedFlatCurry mainmod
mapM_ (copyTransTypedFlatCurry opts) transmods
cleanMain mainmod = do
......
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