Skip to content

Commit

Permalink
Add pcf to data-files
Browse files Browse the repository at this point in the history
  • Loading branch information
dopamane committed Jun 12, 2024
1 parent 4a70de7 commit aee1314
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions bayeux.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ copyright: David Cox
category: Language
build-type: Simple
extra-doc-files: CHANGELOG.md
data-files: data/**/*.pcf

library
ghc-options: -Wall
Expand All @@ -20,8 +21,11 @@ library
, Bayeux.RgbCounter
, Bayeux.Rtlil
, Bayeux.Tableaux
other-modules: Paths_bayeux
autogen-modules: Paths_bayeux
build-depends: base
, containers
, filepath
, megaparsec
, mtl
, parser-combinators
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions lib/Bayeux.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ import Data.Maybe
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Data.Set as S
import Paths_bayeux
import System.FilePath
import Text.Megaparsec hiding (parse)

app :: Cli -> IO ()
app = \case
CliDemo demo iceprog -> case demo of
FiatLux -> flow iceprog "FiatLux" "exe/FiatLux.pcf" fiatLux
RgbCounter -> flow iceprog "RgbCounter" "exe/RgbCounter.pcf" rgbCounter
RgbCycle -> flow iceprog "RgbCycle" "exe/RgbCycle.pcf" rgbCycle
FiatLux -> flow iceprog "FiatLux" fiatLux =<< getDataFileName ("data" </> "FiatLux" <.> "pcf")
RgbCounter -> flow iceprog "RgbCounter" rgbCounter =<< getDataFileName ("data" </> "RgbCounter" <.> "pcf")
RgbCycle -> flow iceprog "RgbCycle" rgbCycle =<< getDataFileName ("data" </> "RgbCycle" <.> "pcf")
CliProve cli -> do
lp <- fromJust <$> case input cli of
FileInput f -> parseMaybe (parse <* eof) <$> TIO.readFile f
Expand Down
4 changes: 2 additions & 2 deletions lib/Bayeux/Flow.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import qualified Data.Text.IO as TIO
import Prettyprinter
import Prettyprinter.Render.Text

flow :: Bool -> String -> FilePath -> File -> IO ()
flow prog name pcfFile designFile = shake shakeOptions{ shakeFiles = "_build" </> name } $ do
flow :: Bool -> String -> File -> FilePath -> IO ()
flow prog name designFile pcfFile = shake shakeOptions{ shakeFiles = "_build" </> name } $ do

want $ if prog
then ["prog"]
Expand Down

0 comments on commit aee1314

Please sign in to comment.