Commit 992aa20a authored by Kai-Oliver Prott's avatar Kai-Oliver Prott

Cleanup cabal file and fix the new warnings from those changes

parent 84d50a9e
cabal-dev/
dist/
.curry/
.cabal-sandbox/
cabal.sandbox.config
dist-newstyle/
.stack-work/
cabal.project.local
.ghc.environment.*
.curry
Name: curry-frontend
Version: 2.0.0
Cabal-Version: >= 1.10
Cabal-Version: 2.0
Synopsis: Compile the functional logic language Curry to several
intermediate formats
Description: The Curry front end consists of the executable program
......@@ -33,32 +33,28 @@ source-repository head
type: git
location: https://git.ps.informatik.uni-kiel.de/curry/curry-frontend.git
Flag network-uri
description: Get Network.URI from the network-uri package
default: True
Library
hs-source-dirs: src
default-language: Haskell2010
Build-Depends:
base == 4.*
, containers
, curry-base == 1.2.0
, directory
, template-haskell >= 2.10 && < 3
, bytestring >= 0.10 && < 0.11
default-language: Haskell2010
other-extensions: CPP, TemplateHaskell, OverloadedStrings
ghc-options: -Wall
build-depends:
base >= 4.11
, template-haskell >= 2.10
, extra >= 1.4.6
, filepath
, transformers
, mtl
, pretty
, process
, directory >= 1.2.0.1
, filepath
, file-embed
, containers
, set-extra
, transformers
if flag(network-uri)
build-depends: network-uri >= 2.6
else
build-depends: network < 2.6
Exposed-Modules:
, bytestring >= 0.10
, process
, network-uri >= 2.6
, pretty
, curry-base == 1.2.0
exposed-modules:
Base.AnnotExpr
, Base.CurryKinds
, Base.CurryTypes
......@@ -107,7 +103,6 @@ Library
, Env.Value
, Exports
, Files.CymakePath
, Files.Embed
, Generators
, Generators.GenAbstractCurry
, Generators.GenFlatCurry
......@@ -134,39 +129,45 @@ Library
, Transformations.Newtypes
, Transformations.Qual
, Transformations.Simplify
Other-Modules:
other-modules:
Paths_curry_frontend
autogen-modules:
Paths_curry_frontend
ghc-options: -Wall -fno-warn-orphans
Executable curry-frontend
hs-source-dirs: src
Main-is: cymake.hs
default-language: Haskell2010
Build-Depends:
base == 4.*
, containers
, curry-base == 1.2.0
, curry-frontend
, directory
, template-haskell >= 2.10 && < 3
, bytestring >= 0.10 && < 0.11
hs-source-dirs: src
Main-is: cymake.hs
default-language: Haskell2010
other-extensions: CPP, TemplateHaskell, OverloadedStrings
ghc-options: -Wall
build-depends:
base >= 4.11
, template-haskell >= 2.10
, extra >= 1.4.6
, filepath
, transformers
, mtl
, pretty
, process
, directory >= 1.2.0.1
, filepath
, file-embed
, containers
, set-extra
, transformers
if flag(network-uri)
build-depends: network-uri >= 2.6
else
build-depends: network < 2.6
ghc-options: -Wall -fno-warn-orphans
, bytestring >= 0.10
, process
, network-uri >= 2.6
, pretty
, curry-base == 1.2.0
, curry-frontend
Test-Suite test-frontend
type: detailed-0.9
hs-source-dirs: test
default-language: Haskell2010
test-module: TestFrontend
build-depends: base == 4.*, Cabal >= 1.20, curry-base == 1.2.0
, curry-frontend, filepath
type: detailed-0.9
hs-source-dirs: test
test-module: TestFrontend
default-language: Haskell2010
other-extensions: CPP
ghc-options: -Wall
build-depends:
base >= 4.11
, Cabal >= 1.20
, filepath
, curry-base == 1.2.0
, curry-frontend
......@@ -10,7 +10,7 @@
TODO
-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Base.PrettyKinds where
import Curry.Base.Pretty
......
......@@ -10,7 +10,8 @@
TODO
-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Base.PrettyTypes where
#if __GLASGOW_HASKELL__ >= 804
......
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE OverloadedStrings #-}
module Files.Embed (embedDataFile, cssFileName) where
import Prelude (FilePath, Monad(..), ($), fromIntegral)
import Data.ByteString.Unsafe (unsafePackAddressLen)
import Data.ByteString (ByteString, unpack, length, readFile)
import System.IO.Unsafe (unsafePerformIO)
import Language.Haskell.TH.Syntax (Q, Exp(..), Lit(..), runIO)
import Paths_curry_frontend (getDataFileName)
-- | embed a file from the data dir within the code
embedDataFile :: FilePath -> Q Exp
embedDataFile fn = do
fp <- runIO $ getDataFileName fn
c <- runIO $ readFile fp
bsToExp c
bsToExp :: ByteString -> Q Exp
bsToExp bs =
return $ VarE 'unsafePerformIO
`AppE` (VarE 'unsafePackAddressLen
`AppE` LitE (IntegerL $ fromIntegral $ length bs)
`AppE` LitE (StringPrimL $ unpack bs))
cssFileName :: FilePath
cssFileName = "currysource.css"
......@@ -20,6 +20,7 @@ import Control.Monad.Writer
import Data.List (mapAccumL)
import Data.Maybe (fromMaybe, isJust)
import Data.ByteString as BS (ByteString, writeFile)
import Data.FileEmbed
import Network.URI (escapeURIString, isUnreserved)
import System.FilePath ((</>))
......@@ -32,13 +33,17 @@ import Curry.Syntax (Module (..), Token)
import Html.SyntaxColoring
import Files.Embed
import CompilerOpts (Options (..))
-- |Read file via TemplateHaskell at compile time
cssContent :: ByteString
cssContent = $(embedDataFile cssFileName)
cssContent = $(makeRelativeToProject "data/currysource.css" >>= embedFile)
-- | Name of the css file
-- NOTE: The relative path is given above
cssFileName :: String
cssFileName = "currysource.css"
-- |Translate source file into HTML file with syntaxcoloring
source2html :: Options -> ModuleIdent -> [(Position, Token)] -> Module a
......
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