Skip to content

Commit 29f6799

Browse files
committed
Fix cabal check output
1 parent 0438a36 commit 29f6799

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-2.4"]}}
4343
os: linux
4444
before_install:
45-
- set -x
4645
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
4746
- WITHCOMPILER="-w $HC"
4847
- HADDOCK=$(echo "/opt/$CC/bin/haddock" | sed 's/-/\//')

datafix.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ test-suite tests
104104
Analyses.Syntax.MkCoreFromFile
105105
Analyses.Templates.LetDn
106106
SetRecurrences.FirstFollow
107-
SetRecurrences.FirstFollow
108107
Fib
109108
Fac
110109
Mutual
@@ -185,8 +184,9 @@ benchmark benchmarks
185184
executable firstfollow-example
186185
default-language: Haskell2010
187186
hs-source-dirs: examples
188-
main-is: SetRecurrences/FirstFollow.hs
189-
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N -main-is SetRecurrences.FirstFollow
187+
main-is: SetRecurrences/FirstFollow/Main.hs
188+
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
189+
other-modules: SetRecurrences.FirstFollow
190190
build-depends: base
191191
, containers
192192
, datafix

examples/SetRecurrences/FirstFollow.hs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ module SetRecurrences.FirstFollow
2020
, llsll
2121
, emptyL
2222
, leftrec
23-
, main
2423
) where
2524

2625
import Prelude hiding (words)
@@ -203,19 +202,3 @@ leftrec = augmentGrammar 'O' $ mkGrammar
203202
, ('A', "c")
204203
]
205204
'S'
206-
207-
main :: IO ()
208-
main = do
209-
(k:_) <- map read <$> getArgs
210-
let uncurry3 f (x,y,z) = f x y z
211-
let analyse name gr (s :: Char) = do
212-
printf "%s:\n" name
213-
printf " first_%d(%s): %s\n" k (show s) (show $ first k gr [NT s])
214-
printf " follow_%d(%s): %s\n" k (show s) (show $ follow k gr s)
215-
putStrLn ""
216-
mapM_ (uncurry3 analyse) $
217-
[ ("Dyck", dyck, 'S')
218-
, ("LL(1), not SLL(k)", llsll, 'A')
219-
, ("empty", emptyL, 'A')
220-
, ("left recursive", leftrec, 'S')
221-
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{-# LANGUAGE ScopedTypeVariables #-}
2+
{-# LANGUAGE FlexibleContexts #-}
3+
4+
import System.Environment
5+
import Text.Printf
6+
import SetRecurrences.FirstFollow
7+
8+
main :: IO ()
9+
main = do
10+
(k:_) <- map read <$> getArgs
11+
let uncurry3 f (x,y,z) = f x y z
12+
let analyse name gr (s :: Char) = do
13+
printf "%s:\n" name
14+
printf " first_%d(%s): %s\n" k (show s) (show $ first k gr [NT s])
15+
printf " follow_%d(%s): %s\n" k (show s) (show $ follow k gr s)
16+
putStrLn ""
17+
mapM_ (uncurry3 analyse) $
18+
[ ("Dyck", dyck, 'S')
19+
, ("LL(1), not SLL(k)", llsll, 'A')
20+
, ("empty", emptyL, 'A')
21+
, ("left recursive", leftrec, 'S')
22+
]
23+

0 commit comments

Comments
 (0)