Permalink
Browse files

Add another example and update test file.

  • Loading branch information...
1 parent ce2be7d commit 0787b08ff597ae6eb300fa099dc9af490f9c749b @nominolo committed Oct 20, 2008
Showing with 32 additions and 1 deletion.
  1. +16 −0 examples/ThingAtPoint.hs
  2. +8 −0 scion.cabal
  3. +8 −1 tests/Test001.hs
View
@@ -0,0 +1,16 @@
+import GHC
+import Scion
+import Scion.Utils
+import Outputable
+
+main = runScion $ do
+ addTarget =<< guessTarget "./tests/Test001.hs" Nothing
+ load LoadAllTargets
+ [ms] <- modulesInDepOrder
+ mod <- typecheckModule =<< parseModule ms
+ let Just (grp, _, _, _, _) = renamedSource mod
+ --io $ putStrLn $ showSDoc $ ppr $ grp
+ let tyclds = thingsAroundPoint (8,5) (hs_tyclds grp)
+ io $ putStrLn $ showSDoc $ ppr $ tyclds
+ return ()
+
View
@@ -44,3 +44,11 @@ executable test_call_graph
build-depends: ghc >= 6.10 && < 6.12,
ghc-uniplate == 0.1.*
other-modules: Scion
+
+executable test_thing_at_point
+ main-is: ThingAtPoint.hs
+ hs-source-dirs: examples
+ src
+ build-depends: ghc >= 6.10 && < 6.12,
+ ghc-uniplate == 0.1.*
+ other-modules: Scion
View
@@ -2,4 +2,11 @@ module Main where
import Data.Maybe ( fromMaybe )
-main = print (fromMaybe (Just 3))
+main = print (fromMaybe 0 (Just 3))
+
+data Foo = Foo0
+ | Foo2 Foo Foo
+
+instance Show Foo where
+ show Foo0 = "*"
+ show (Foo2 f1 f2) = "(" ++ show f1 ++ "-" ++ show f2 ++ ")"

0 comments on commit 0787b08

Please sign in to comment.