Skip to content

Commit

Permalink
Added cabal files
Browse files Browse the repository at this point in the history
Ignore-this: 789e65c28b4a69e8a150968360c56be0

darcs-hash:20100309022907-09b00-ea534af749b879255a27cbe8e92333604c3772a4
  • Loading branch information
xy-kasumi committed Mar 9, 2010
1 parent 2e617ac commit 2a1ff50
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Control.Monad
import System.Environment
import System.FilePath.Posix
import System.IO
import qualified Paths_hs2bf

import Util
import qualified Front
Expand Down Expand Up @@ -101,7 +102,8 @@ execCommand (Compile opt from)=partialChain opt from $
where f g=runProcessWithIO (putStr . g)

partialChain opt from (c0,c1,g0,g1,s0,s1,b)=do
let (mod,env)=analyzeName from
dir<-liftM takeDirectory $ Paths_hs2bf.getDataFileName "Prelude.hs"
let (mod,env)=analyzeName from dir
xs<-Front.collectModules env mod
let cr =xs >>= Front.compile
cr' =cr >>= Core.simplify
Expand Down Expand Up @@ -154,8 +156,8 @@ help=unlines $



analyzeName :: String -> (String,Front.ModuleEnv)
analyzeName n=(takeBaseName n,Front.ModuleEnv [dirPrefix++takeDirectory n,"./test"])
analyzeName :: String -> FilePath -> (String,Front.ModuleEnv)
analyzeName n lib=(takeBaseName n,Front.ModuleEnv [dirPrefix++takeDirectory n,lib])
where dirPrefix=if isAbsolute n then "" else "./"


3 changes: 3 additions & 0 deletions Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Distribution.Simple
main=defaultMain

9 changes: 8 additions & 1 deletion gendoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

HsColour -print-css > doc/hscolour.css

# generate file list
for i in *.hs
if test $i != Setup.hs
set FLIST $FLIST $i
end
end

for i in $FLIST
HsColour -odoc/$i.html -css -anchor $i
end

haddock -h --source-module="%F.html" --source-entity="%F.html#line-%L" -o doc *.hs
haddock -h --source-module="%F.html" --source-entity="%F.html#line-%L" -o doc $FLIST
23 changes: 23 additions & 0 deletions hs2bf.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: hs2bf
cabal-version: >=1.2
version: 0.5
author: xanxys
maintainer: [email protected]
synopsis: Haskell to Brainfu*k compiler
license: BSD3
license-File: LICENSE
category: Compiler
description: Haskell to Brainfu*k compiler.
build-type: Simple
data-files: Prelude.hs
data-dir: test
tested-with: GHC==6.10.4
extra-source-files:
Front.hs Core.hs GMachine.hs SAM.hs SCGR.hs Brainfuck.hs
Util.hs SRuntime.hs
executable hs2bf
main-is: Main.hs
build-depends:
containers>=0.1, base>=4, mtl>=1, array>=0.2,
filepath>=1, directory>=1, haskell-src>=1

0 comments on commit 2a1ff50

Please sign in to comment.