Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PCF to data-files #10

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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