Commit 5e9c330b authored by Fredrik Wieczerkowski's avatar Fredrik Wieczerkowski
Browse files

Replace remaining uses of 'cymake' with 'frontend'

parent bc63970a
Pipeline #5037 passed with stages
in 8 minutes and 53 seconds
......@@ -7,7 +7,7 @@ export ROOT=$(CURDIR)
# binary directory and executables
export BINDIR=$(ROOT)/bin
# The frontend binary
export CYMAKE = $(BINDIR)/curry-frontend
export FRONTEND = $(BINDIR)/curry-frontend
# The stack binary
STACK = stack
......@@ -23,7 +23,7 @@ clean:
.PHONY: cleanall
cleanall:
$(STACK) clean --full
rm -f $(CYMAKE) && rm -rf bin
rm -f $(FRONTEND) && rm -rf bin
.PHONY: runtests
runtests:
......
......@@ -17,18 +17,18 @@ module Main (main) where
import Curry.Base.Monad (runCYIO)
import Base.Messages
import Files.CymakePath (cymakeGreeting, cymakeVersion)
import Files.FrontendPath (frontendGreeting, frontendVersion)
import CurryBuilder (buildCurry)
import CompilerOpts (Options (..), CymakeMode (..), getCompilerOpts, usage)
import CompilerOpts (Options (..), FrontendMode (..), getCompilerOpts, usage)
-- |The command line tool cymake
-- |The command line tool frontend
main :: IO ()
main = getCompilerOpts >>= cymake
main = getCompilerOpts >>= runFrontend
-- |Invoke the curry builder w.r.t the command line arguments
cymake :: (String, Options, [String], [String]) -> IO ()
cymake (prog, opts, files, errs) = case optMode opts of
-- |Invoke the curry frontend w.r.t the command line arguments
runFrontend :: (String, Options, [String], [String]) -> IO ()
runFrontend (prog, opts, files, errs) = case optMode opts of
ModeHelp -> printUsage prog
ModeVersion -> printVersion
ModeNumericVersion -> printNumericVersion
......@@ -44,11 +44,11 @@ printUsage prog = putStrLn $ usage prog
-- |Print the program version
printVersion :: IO ()
printVersion = putStrLn cymakeGreeting
printVersion = putStrLn frontendGreeting
-- |Print the numeric program version
printNumericVersion :: IO ()
printNumericVersion = putStrLn cymakeVersion
printNumericVersion = putStrLn frontendVersion
-- |Print errors and abort execution on bad parameters
badUsage :: String -> [String] -> IO ()
......
......@@ -141,7 +141,7 @@ library
, Env.TypeConstructor
, Env.Value
, Exports
, Files.CymakePath
, Files.FrontendPath
, Generators
, Generators.GenAbstractCurry
, Generators.GenFlatCurry
......@@ -174,7 +174,7 @@ library
executable curry-frontend
hs-source-dirs: app
main-is: cymake.hs
main-is: Main.hs
default-language: Haskell2010
ghc-options: -Wall
build-depends:
......
......@@ -188,7 +188,7 @@ Copyright: 2000 - 2004, Wolfgang Lux
2016, Finn Teegen
License: BSD-3-clause
Files: src/Files/CymakePath.hs
Files: src/Files/FrontendPath.hs
Copyright: 2011, Björn Peemöller (bjp@informatik.uni-kiel.de)
License: BSD-3-clause
......@@ -547,7 +547,7 @@ Copyright: 2017, Kai-Oliver Prott
2018, Kai-Oliver Prott
License: BSD-3-clause
Files: app/cymake.hs
Files: app/Main.hs
Copyright: 2005, Martin Engelke
2011-2016, Björn Peemöller
License: BSD-3-clause
......
......@@ -64,7 +64,7 @@ Module overview of package `curry-frontend`
* `.OpPrec` : Operatorpräzedenzen
* `.TypeConstructor`: Typkonstruktoren
* `.Value` : Werte (Funktionen, Konstruktoren, Labels)
* `Files.CymakePath`: Pfad zur binary
* `Files.FrontendPath`: Pfad zur binary
* `Generators`: Generatoren zur Code-Erzeugung
* `GenAbstractCurry`: Erzeugung von AbstractCurry
* `GenFlatCurry` : Erzeugung von FlatCurry
......@@ -87,7 +87,7 @@ Module overview of package `curry-frontend`
* `CompilerOpts` : Optionen für den Compiler
* `CurryBuilder` : Kompilierung eines Moduls inklusive Modulabhängigkeiten
* `CurryDeps` : Berechnung von Modulabhängigkeiten
* `cymake` : Command-line tool
* `Main` : Command-line tool
* `Exports` : Erzeugung des Interfaces
* `Frontend` : API-Modul (to be removed)
* `Imports` : Import von Funktionen etc. aus Schnittstellen
......
......@@ -18,7 +18,7 @@
-}
module CompilerOpts
( Options (..), CppOpts (..), PrepOpts (..), WarnOpts (..), DebugOpts (..)
, OptimizationOpts(..), CaseMode (..), CymakeMode (..), Verbosity (..)
, OptimizationOpts(..), CaseMode (..), FrontendMode (..), Verbosity (..)
, TargetType (..), WarnFlag (..), KnownExtension (..), DumpLevel (..)
, dumpLevel
, defaultOptions, defaultPrepOpts, defaultWarnOpts, defaultDebugOpts, defaultCppOpts
......@@ -44,7 +44,7 @@ import Curry.Syntax.Extension
-- |Compiler options
data Options = Options
-- general
{ optMode :: CymakeMode -- ^ modus operandi
{ optMode :: FrontendMode -- ^ modus operandi
, optVerbosity :: Verbosity -- ^ verbosity level
-- compilation
, optForce :: Bool -- ^ force (re-)compilation of target
......@@ -172,7 +172,7 @@ defaultOptimizationOpts = OptimizationOpts
}
-- |Modus operandi of the program
data CymakeMode
data FrontendMode
= ModeHelp -- ^ Show help information and exit
| ModeVersion -- ^ Show version and exit
| ModeNumericVersion -- ^ Show numeric version, suitable for later processing
......
......@@ -67,6 +67,8 @@ kielExtensions :: [KnownExtension]
kielExtensions = [AnonFreeVars, FunctionalPatterns]
-- |Known Curry tools which may accept compiler options.
-- Note: CYMAKE is kept for legacy/compatibility reasons
-- and is deprecated, specify options for FRONTEND instead.
data KnownTool = KICS2 | PAKCS | CYMAKE | FRONTEND
deriving (Eq, Read, Show, Enum, Bounded, Generic, Binary)
......
......@@ -11,22 +11,22 @@
This module contains functions to obtain the version number and path
of the front end binary.
-}
module Files.CymakePath (getCymake, cymakeGreeting, cymakeVersion) where
module Files.FrontendPath (getFrontend, frontendGreeting, frontendVersion) where
import Data.Version (showVersion)
import System.FilePath ((</>))
import Paths_curry_frontend
-- | Show a greeting of the current front end
cymakeGreeting :: String
cymakeGreeting = "This is the Curry front end, version " ++ cymakeVersion
frontendGreeting :: String
frontendGreeting = "This is the Curry front end, version " ++ frontendVersion
-- | Retrieve the version number of cymake
cymakeVersion :: String
cymakeVersion = showVersion version
-- | Retrieve the version number of frontend
frontendVersion :: String
frontendVersion = showVersion version
-- | Retrieve the location of the front end executable
getCymake :: IO String
getCymake = do
cymakeDir <- getBinDir
return $ cymakeDir </> "curry-frontend"
getFrontend :: IO String
getFrontend = do
frontendDir <- getBinDir
return $ frontendDir </> "curry-frontend"
......@@ -181,7 +181,7 @@ preprocess opts fn src
withTempFile :: (FilePath -> Handle -> IO a) -> IO a
withTempFile act = do
tmp <- getTemporaryDirectory
(fn, hdl) <- openTempFile tmp "cymake.curry"
(fn, hdl) <- openTempFile tmp "FrontendTmp.curry"
res <- act fn hdl
hClose hdl
removeFile fn
......
......@@ -50,7 +50,7 @@ runSecure :: CYIO a -> IO (Either [Message] (a, [Message]))
runSecure act = runCYIO act `E.catch` handler
where handler e = return (Left [message $ text $ show (e :: E.SomeException)])
-- Execute a test by calling cymake
-- Execute a test by calling the frontend
runTest :: CO.Options -> String -> [String] -> IO Progress
runTest opts test errorMsgs =
if null errorMsgs
......
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