Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Started port to GHC 7

  • Loading branch information...
commit e6480ab2b56183651b39db4b06f16cd63fc357f6 1 parent f8174b1
@serras serras authored
View
2  lib/Scion/Ghc.hs
@@ -22,7 +22,7 @@ renamedSourceGroup :: RenamedSource -> HsGroup Name
isUserDefinedId :: Id -> Bool
isRecStmt :: StmtLR idL idR -> Bool
-#if GHC_VERSION < 611
+#if __GLASGOW_HASKELL__ < 611
renamedSourceGroup (grp, _, _, _, _) = grp
View
95 lib/Scion/Inspect.hs
@@ -42,11 +42,19 @@ import Bag
import Var ( varType )
import qualified Var( varName )
import DataCon ( dataConUserType )
+#if __GLASGOW_HASKELL__ < 700
import Type ( tidyType )
+#else
+import TcType ( tidyType )
+#endif
import VarEnv ( emptyTidyEnv )
-import GHC.SYB.Utils()
+
import qualified Outputable as O ( (<>), empty, dot )
+#if __GLASGOW_HASKELL__ < 700
+import GHC.SYB.Utils()
+#endif
+
import Data.Data
import Data.Generics.Biplate
import qualified Data.Generics.Str as U
@@ -60,6 +68,10 @@ import Data.Ord (comparing)
import StringBuffer
#endif
+#if __GLASGOW_HASKELL__ >= 700
+import Util(filterOut)
+#endif
+
#ifdef SCION_DEBUG
--import FastString
import Test.QuickCheck()
@@ -114,7 +126,12 @@ haddockType _="t"
typeDecls :: TypecheckedModule -> [LTyClDecl Name]
typeDecls m =
let srcgrp = renamedSourceGroup `fmap` renamedSource m
- typeDecls' (Just grp) = [ t | t <- hs_tyclds grp
+ typeDecls' (Just grp) = [ t
+#if __GLASGOW_HASKELL__ < 700
+ | t <- hs_tyclds grp
+#else
+ | t <- concat (hs_tyclds grp)
+#endif
, isDataDecl (unLoc t)
|| isTypeDecl (unLoc t)
|| isSynDecl (unLoc t) ]
@@ -137,12 +154,22 @@ typeDeclsParsed pm =
classDecls :: RenamedSource -> [LTyClDecl Name]
classDecls rn_src =
- [ t | t <- hs_tyclds (renamedSourceGroup rn_src)
+ [ t
+#if __GLASGOW_HASKELL__ < 700
+ | t <- hs_tyclds (renamedSourceGroup rn_src)
+#else
+ | t <- concat (hs_tyclds (renamedSourceGroup rn_src))
+#endif
, isClassDecl (unLoc t) ]
familyDecls :: RenamedSource -> [LTyClDecl Name]
familyDecls rn_src =
- [ t | t <- hs_tyclds (renamedSourceGroup rn_src)
+ [ t
+#if __GLASGOW_HASKELL__ < 700
+ | t <- hs_tyclds (renamedSourceGroup rn_src)
+#else
+ | t <- concat (hs_tyclds (renamedSourceGroup rn_src))
+#endif
, isFamilyDecl (unLoc t) ]
toplevelNames :: BgTcCache -> [SDoc]
@@ -217,6 +244,43 @@ mkOutlineDef base_dir (L sp t) =
Nothing
| L sp2 n <- tyClDeclNames t]
+#if __GLASGOW_HASKELL__ >= 700
+-- Taken from http://www.haskell.org/ghc/docs/6.12.2/html/libraries/ghc-6.12.2/src/HsDecls.html#tyClDeclNames
+tyClDeclNames :: Eq name => TyClDecl name -> [Located name]
+-- ^ Returns all the /binding/ names of the decl, along with their SrcLocs.
+-- The first one is guaranteed to be the name of the decl. For record fields
+-- mentioned in multiple constructors, the SrcLoc will be from the first
+-- occurence. We use the equality to filter out duplicate field names
+
+tyClDeclNames (TyFamily {tcdLName = name}) = [name]
+tyClDeclNames (TySynonym {tcdLName = name}) = [name]
+tyClDeclNames (ForeignType {tcdLName = name}) = [name]
+
+tyClDeclNames (ClassDecl {tcdLName = cls_name, tcdSigs = sigs, tcdATs = ats})
+ = cls_name :
+ concatMap (tyClDeclNames . unLoc) ats ++ [n | L _ (TypeSig n _) <- sigs]
+
+tyClDeclNames (TyData {tcdLName = tc_name, tcdCons = cons})
+ = tc_name : hsConDeclsNames cons
+
+-- Taken from http://www.haskell.org/ghc/docs/6.12.2/html/libraries/ghc-6.12.2/src/HsDecls.html#hsConDeclsNames
+hsConDeclsNames :: (Eq name) => [LConDecl name] -> [Located name]
+ -- See tyClDeclNames for what this does
+ -- The function is boringly complicated because of the records
+ -- And since we only have equality, we have to be a little careful
+hsConDeclsNames cons
+ = snd (foldl do_one ([], []) cons)
+ where
+ do_one (flds_seen, acc) (L _ (ConDecl { con_name = lname, con_details = RecCon flds }))
+ = (map unLoc new_flds ++ flds_seen, lname : new_flds ++ acc)
+ where
+ new_flds = filterOut (\f -> unLoc f `elem` flds_seen)
+ (map cd_fld_name flds)
+
+ do_one (flds_seen, acc) (L _ (ConDecl { con_name = lname }))
+ = (flds_seen, lname:acc)
+#endif
+
valBinds :: FilePath -> HsGroup Name -> [OutlineDef]
valBinds base_dir grp =
let ValBindsOut bind_grps _sigs = hs_valds grp
@@ -269,7 +333,12 @@ outline ::FilePath -- ^ The base directory for relative source locations,
outline base_dir (Typechecked mod) =
let srcgroup = renamedSourceGroup `fmap` renamedSource mod
- outline' (Just grp) = concatMap (mkOutlineDef base_dir) (hs_tyclds grp)
+ outline' (Just grp) = concatMap (mkOutlineDef base_dir)
+#if __GLASGOW_HASKELL__ < 700
+ (hs_tyclds grp)
+#else
+ (concat $ hs_tyclds grp)
+#endif
++ valBinds base_dir grp
++ instBinds base_dir grp
outline' _ = []
@@ -313,7 +382,11 @@ ghctokensArbitrary base_dir contents = do
--setActiveComponent comp
--setComponentDynFlags comp
dflags0 <- getSessionDynFlags
+#if __GLASGOW_HASKELL__ >= 700
+ let dflags1 = List.foldl' xopt_set dflags0 lexerFlags
+#else
let dflags1 = List.foldl' dopt_set dflags0 lexerFlags
+#endif
--let dflags1 = dflags0{flags=(Opt_TemplateHaskell:(flags dflags0))}
let prTS = lexTokenStream sb (mkSrcLoc (mkFastString "<interactive>") 1 0) dflags1
--setSessionDynFlags dflags0
@@ -321,7 +394,11 @@ ghctokensArbitrary base_dir contents = do
POk _ toks -> return $ Right $ (filter ofInterest toks)
PFailed loc msg -> return $ Left $ ghcErrMsgToNote base_dir $ mkPlainErrMsg loc msg
+#if __GLASGOW_HASKELL__ >= 700
+lexerFlags :: [ExtensionFlag]
+#else
lexerFlags :: [DynFlag]
+#endif
lexerFlags =
[ Opt_ForeignFunctionInterface
, Opt_PArr
@@ -331,7 +408,9 @@ lexerFlags =
, Opt_ImplicitParams
, Opt_BangPatterns
, Opt_TypeFamilies
+#if __GLASGOW_HASKELL__ < 700
, Opt_Haddock
+#endif
, Opt_MagicHash
, Opt_KindSignatures
, Opt_RecursiveDo
@@ -648,7 +727,7 @@ tokenType ITusing= "EK"
-- Pragmas
tokenType (ITinline_prag {})="P" -- True <=> INLINE, False <=> NOINLINE
-#if __GLASGOW_HASKELL__ >= 612
+#if __GLASGOW_HASKELL__ >= 612 && __GLASGOW_HASKELL__ < 700
tokenType (ITinline_conlike_prag {})="P" -- same
#endif
tokenType ITspec_prag="P" -- SPECIALISE
@@ -662,7 +741,7 @@ tokenType ITscc_prag="P"
tokenType ITgenerated_prag="P"
tokenType ITcore_prag="P" -- hdaume: core annotations
tokenType ITunpack_prag="P"
-#if __GLASGOW_HASKELL__ >= 612
+#if __GLASGOW_HASKELL__ >= 612 && __GLASGOW_HASKELL__ < 700
tokenType ITann_prag="P"
#endif
tokenType ITclose_prag="P"
@@ -754,7 +833,7 @@ tokenType ITrarrowtail="A" -- >-
tokenType ITLarrowtail="A" -- -<<
tokenType ITRarrowtail="A" -- >>-
-#if GHC_VERSION < 611
+#if __GLASGOW_HASKELL__ <= 611
tokenType ITdotnet="SS" -- ??
tokenType (ITpragma _) = "SS" -- ??
#endif
View
6 lib/Scion/Inspect/DefinitionSite.hs
@@ -26,7 +26,7 @@ import PprTyThing ( pprTyThingInContext )
import TyCon ( isCoercionTyCon, isFamInstTyCon )
import HscTypes ( isBootSummary )
-#if GHC_VERSION < 611
+#if __GLASGOW_HASKELL__ < 611
import Var ( globalIdVarDetails )
import IdInfo ( GlobalIdDetails(..) )
#else
@@ -87,7 +87,7 @@ mkSiteDB base_dir ty_things = foldl' go emptyDefSiteDB ty_things
ty_thing db
is_interesting_id ident =
-#if GHC_VERSION < 611
+#if __GLASGOW_HASKELL__ < 611
case globalIdVarDetails ident of
VanillaGlobal -> True
ClassOpId _ -> True
@@ -122,7 +122,7 @@ dumpDefSiteDB (DefSiteDB m) = unlines (map pp (M.assocs m))
| (l, t) <- l_ty_things ]
pp_ty_thing tt@(AnId ident) =
-#if GHC_VERSION < 611
+#if __GLASGOW_HASKELL__ < 611
showSDoc (pprTyThingInContext False tt <+> ppr (globalIdVarDetails ident))
#else
showSDoc (pprTyThingInContext False tt <+> ppr (idDetails ident))
View
143 lib/Scion/Inspect/Find.hs
@@ -301,8 +301,13 @@ instance (Search id id) => Search id (HsExpr id) where
SectionL e o -> search p s e `mappend` search p s o
SectionR o e -> search p s o `mappend` search p s e
HsCase e mg -> search p s e `mappend` search p s mg
+#if __GLASGOW_HASKELL__ < 700
HsIf c t e -> search p s c `mappend` search p s t
`mappend` search p s e
+#else
+ HsIf _ c t e -> search p s c `mappend` search p s t
+ `mappend` search p s e
+#endif
HsLet bs e -> search p s bs `mappend` search p s e
HsDo _ ss e _ -> search p s ss `mappend` search p s e
ExplicitList _ es -> search p s es
@@ -329,7 +334,7 @@ instance (Search id id) => Search id (HsExpr id) where
HsWrap _ e -> search p s e
_ -> mempty
-#if GHC_VERSION > 610
+#if __GLASGOW_HASKELL__ > 610
instance (Search id id) => Search id (HsTupArg id) where
search p s (Present e) = search p s e
search _ _ _ = mempty
@@ -358,9 +363,16 @@ instance (Search id id) => Search id (StmtLR id id) where
ExprStmt e _ _ -> search p s e
LetStmt bs -> search p s bs
ParStmt ss -> search p s (concatMap fst ss)
+#if __GLASGOW_HASKELL__ < 700
TransformStmt (ss,_) f e -> search p s ss `mappend` search p s f
`mappend` search p s e
GroupStmt (ss, _) g -> search p s ss `mappend` search p s g
+#else
+ TransformStmt ss _ f e -> search p s ss `mappend` search p s f
+ `mappend` search p s e
+ GroupStmt ss _ g gg -> search p s ss `mappend` search p s g
+ `mappend` either (search p s) (const mempty) gg
+#endif
stm | isRecStmt stm -> search p s (recS_stmts stm)
--
@@ -380,10 +392,12 @@ instance (Search id id) => Search id (StmtLR id id) where
-- preserved, so this is fine.
--
+#if __GLASGOW_HASKELL__ < 700
instance (Search id id) => Search id (GroupByClause id) where
search p s (GroupByNothing f) = search p s f
search p s (GroupBySomething using_f e) =
either (search p s) (const mempty) using_f `mappend` search p s e
+#endif
instance (Search id id) => Search id (ArithSeqInfo id) where
search p s (From e) = search p s e
@@ -400,12 +414,131 @@ instance Search id e => Search id (HsRecField id e) where
search p s (HsRecField _lid a _) = search p s a
instance (Search id id) => Search id (HsBracket id) where
- search p s (ExpBr e) = search p s e
- search p s (PatBr q) = search p s q
+ search p s (ExpBr e) = search p s e
+ search p s (PatBr q) = search p s q
+#if __GLASGOW_HASKELL__ < 700
search p s (DecBr g) = search p s g
- search p s (TypBr t) = search p s t
- search _ _ (VarBr _) = mempty
+#else
+ search p s (DecBrL g) = search p s g
+ search p s (DecBrG g) = search p s g
+#endif
+ search p s (TypBr t) = search p s t
+ search _ _ (VarBr _) = mempty
instance (Search id id) => Search id (HsSplice id) where
search p s (HsSplice _ e) = search p s e
+#if __GLASGOW_HASKELL__ >= 700
+instance (Search id id) => Search id ([id], [id]) where
+ search p s (a, b) = search p s a `mappend` search p s b
+
+instance (Search id id) => Search id (HsDecl id) where
+ search p s (TyClD e) = search p s e
+ search p s (InstD e) = search p s e
+ search p s (DerivD e) = search p s e
+ search p s (ValD e) = search p s e
+ search p s (SigD e) = search p s e
+ search p s (DefD e) = search p s e
+ search p s (ForD e) = search p s e
+ search p s (WarningD e) = search p s e
+ search p s (AnnD e) = search p s e
+ search p s (RuleD e) = search p s e
+ search p s (SpliceD e) = search p s e
+ search p s (DocD e) = search p s e
+ search p s (QuasiQuoteD e) = search p s e
+
+instance (Search id id) => Search id (TyClDecl id) where
+ search p s (ForeignType n _) = search p s n
+ search p s (TyFamily _ n ns _) = search p s n `mappend` search p s ns
+ search p s (TyData _ ct n v pt _ c d) = search p s ct `mappend` search p s n
+ `mappend` search p s v
+ `mappend` search p s pt
+ `mappend` search p s c
+ `mappend` search p s d
+ search p s (TySynonym n v pt r) = search p s n `mappend` search p s v
+ `mappend` search p s pt
+ `mappend` search p s r
+ search p s (ClassDecl ct n v fd sg m tt dc) = search p s ct `mappend` search p s n
+ `mappend` search p s v
+ `mappend` search p s fd
+ `mappend` search p s sg
+ `mappend` search p s m
+ `mappend` search p s tt
+ `mappend` search p s dc
+
+instance (Search id id) => Search id (InstDecl id) where
+ search p s (InstDecl t b sg dc) = search p s t `mappend` search p s b
+ `mappend` search p s sg
+ `mappend` search p s dc
+
+instance (Search id id) => Search id (DerivDecl id) where
+ search p s (DerivDecl t) = search p s t
+
+instance (Search id id) => Search id (Sig id) where
+ search p s (TypeSig n t) = search p s n `mappend` search p s t
+ -- search p s (IdSig i) = search p s i
+ search p s (FixSig n) = search p s n
+ search p s (InlineSig n _) = search p s n
+ search p s (SpecSig n t _) = search p s n `mappend` search p s t
+ search p s (SpecInstSig t) = search p s t
+
+instance (Search id id) => Search id (FixitySig id) where
+ search p s (FixitySig n _) = search p s n
+
+instance (Search id id) => Search id (DefaultDecl id) where
+ search p s (DefaultDecl n) = search p s n
+
+instance (Search id id) => Search id (ForeignDecl id) where
+ search p s (ForeignImport n t _) = search p s n `mappend` search p s t
+ search p s (ForeignExport n t _) = search p s n `mappend` search p s t
+
+instance (Search id id) => Search id (WarnDecl id) where
+ search p s (Warning n _) = search p s n
+
+instance (Search id id) => Search id (AnnDecl id) where
+ search p s (HsAnnotation pr n) = search p s pr `mappend` search p s n
+
+instance (Search id id) => Search id (AnnProvenance id) where
+ search p s (ValueAnnProvenance n) = search p s n
+ search p s (TypeAnnProvenance n) = search p s n
+ search _ _ (ModuleAnnProvenance) = mempty
+
+instance (Search id id) => Search id (RuleDecl id) where
+ search p s (HsRule _ _ bn e1 _ e2 _) = search p s bn `mappend` search p s e1
+ `mappend` search p s e2
+
+instance (Search id id) => Search id (RuleBndr id) where
+ search p s (RuleBndr n) = search p s n
+ search p s (RuleBndrSig n t) = search p s n `mappend` search p s t
+
+instance (Search id id) => Search id (SpliceDecl id) where
+ search p s (SpliceDecl n _) = search p s n
+
+instance (Search id id) => Search id DocDecl where
+ search _ _ _ = mempty
+
+instance (Search id id) => Search id (HsQuasiQuote id) where
+ search _ _ _ = mempty
+
+instance (Search id id) => Search id (ConDecl id) where
+ search p s (ConDecl n _ qv ct dt res _ _) = search p s n `mappend` search p s qv
+ `mappend` search p s ct
+ `mappend` search p s dt
+ `mappend` search p s res
+
+instance (Search id id) => Search id (ConDeclField id) where
+ search p s (ConDeclField n t _) = search p s n `mappend` search p s t
+
+instance (Search id id) => Search id (HsPred id) where
+ search p s (HsClassP n t) = search p s n `mappend` search p s t
+ search p s (HsEqualP n1 n2) = search p s n1 `mappend` search p s n2
+ search p s (HsIParam i n) = search p s i `mappend` search p s n
+
+instance (Search id id) => Search id (HsTyVarBndr id) where
+ search p s (UserTyVar n _) = search p s n
+ search p s (KindedTyVar n _) = search p s n
+
+instance (Search id id) => Search id (ResType id) where
+ search _ _ (ResTyH98) = mempty
+ search p s (ResTyGADT n) = search p s n
+#endif
View
5 lib/Scion/Inspect/IFaceLoader.hs
@@ -43,7 +43,12 @@ import TcRnMonad
import OccName
import IfaceSyn
import RdrName
+
+#if __GLASGOW_HASKELL__ < 700
import LazyUniqFM
+#else
+import UniqFM ( lookupUFM )
+#endif
-- System imports
import System.Directory
View
7 lib/Scion/Inspect/TypeOf.hs
@@ -30,9 +30,14 @@ typeOf (FoundId ident, path) =
unwrap (WpTyApp t') t = AppTy t t'
unwrap (WpTyLam tv) t = ForAllTy tv t
-- do something else with coercion/dict vars?
+#if __GLASGOW_HASKELL__ < 700
unwrap (WpApp v) t = AppTy t (TyVarTy v)
unwrap (WpLam v) t = ForAllTy v t
- unwrap (WpLet _bs) t = t
+#else
+ -- unwrap (WpEvApp v) t = AppTy t (TyVarTy v)
+ unwrap (WpEvLam v) t = ForAllTy v t
+#endif
+ -- unwrap (WpLet _bs) t = t
#ifdef WPINLINE
unwrap WpInline t = t
#endif
View
169 scion.cabal
@@ -1,5 +1,5 @@
name: scion
-version: 0.1.0.8
+version: 0.1.0.9
license: BSD3
license-file: docs/LICENSE
author: Thomas Schilling <nominolo@googlemail.com>
@@ -40,35 +40,59 @@ flag cabal_1_8
description: Enable the Cabal library 1.8 features
default: False
+flag cabal_1_10
+ description: Enable the Cabal library 1.10 features
+ default: False
+
library
build-depends:
base == 4.*,
- containers >= 0.2 && < 0.4,
- directory == 1.0.*,
- filepath == 1.1.*,
hslogger >= 1.0,
- ghc >= 6.10 && < 6.13,
ghc-paths == 0.1.*,
- ghc-syb,
- ghc-syb-utils,
AttoJson >= 0.5.8,
multiset >= 0.1 && < 0.3,
- time == 1.1.*,
+ time == 1.2.*,
uniplate,
list-tries,
binary == 0.5.*,
array >= 0.2 && < 0.4,
old-time == 1.0.*
-
- if flag(cabal_1_8)
+
+ if impl(ghc >= 7.0)
build-depends:
- Cabal >= 1.8,
- hslogger >= 1.1
- cpp-options: -DCABAL_VERSION=108
+ containers >= 0.2 && < 0.5,
+ directory == 1.1.*,
+ filepath == 1.2.*,
+ ghc >= 7,
+ syb,
+ ghc-syb-utils >= 0.3,
+ time == 1.2.*,
+ bytestring
else
build-depends:
- Cabal == 1.6.*
- cpp-options: -DCABAL_VERSION=106
+ containers >= 0.2 && < 0.4,
+ directory == 1.0.*,
+ filepath == 1.1.*,
+ ghc >= 6.10 && < 6.13,
+ ghc-syb,
+ ghc-syb-utils,
+ time == 1.1.*
+
+ if flag(cabal_1_10)
+ build-depends:
+ Cabal >= 1.10,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=110
+ else
+ if flag(cabal_1_8)
+ build-depends:
+ Cabal >= 1.8,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=108
+ else
+ build-depends:
+ Cabal == 1.6.*
+ cpp-options: -DCABAL_VERSION=106
hs-source-dirs: lib
extensions: CPP, PatternGuards, DeriveDataTypeable
@@ -122,40 +146,66 @@ executable scion-server
build-depends:
-- From the library:
base == 4.*,
- containers >= 0.2 && < 0.4,
- directory == 1.0.*,
- filepath == 1.1.*,
- ghc >= 6.10 && < 6.13,
ghc-paths == 0.1.*,
- ghc-syb,
- ghc-syb-utils,
hslogger >= 1.0,
AttoJson >= 0.5.8,
multiset >= 0.1 && < 0.3,
- time == 1.1.*,
list-tries ,
binary == 0.5.*,
array >= 0.2 && < 0.4,
old-time == 1.0.*
- if flag(cabal_1_8)
+ if impl(ghc >= 7.0)
build-depends:
- Cabal >= 1.8,
- hslogger >= 1.1
- cpp-options: -DCABAL_VERSION=108
+ containers >= 0.2 && < 0.5,
+ directory == 1.1.*,
+ filepath == 1.2.*,
+ ghc >= 7,
+ syb,
+ ghc-syb-utils >= 0.3,
+ time == 1.2.*,
+ bytestring
else
build-depends:
- Cabal == 1.6.*
- cpp-options: -DCABAL_VERSION=106
+ containers >= 0.2 && < 0.4,
+ directory == 1.0.*,
+ filepath == 1.1.*,
+ ghc >= 6.10 && < 6.13,
+ ghc-syb,
+ ghc-syb-utils,
+ time == 1.1.*
+
+ if flag(cabal_1_10)
+ build-depends:
+ Cabal >= 1.10,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=110
+ else
+ if flag(cabal_1_8)
+ build-depends:
+ Cabal >= 1.8,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=108
+ else
+ build-depends:
+ Cabal == 1.6.*
+ cpp-options: -DCABAL_VERSION=106
if flag(server)
+
+ if impl(ghc >= 7.0)
+ build-depends:
+ network >= 2.3
+ else
+ build-depends:
+ network >= 2.1 && < 2.3,
+ network-bytestring == 0.1.*
+
build-depends:
-- Server only
bytestring == 0.9.*,
- network >= 2.1 && < 2.3,
- network-bytestring == 0.1.*,
utf8-string == 0.3.*
-
+
other-modules:
Scion,
Scion.Cabal,
@@ -202,34 +252,41 @@ executable scion-test
main-is: Test.hs
build-depends:
base == 4.*,
- containers >= 0.2 && < 0.4,
- directory == 1.0.*,
- filepath == 1.1.*,
- ghc >= 6.10 && < 6.13,
+ containers >= 0.2 && < 0.5,
+ directory == 1.1.*,
+ filepath == 1.2.*,
+ ghc >= 7,
ghc-paths == 0.1.*,
- ghc-syb,
- ghc-syb-utils,
+ ghc-syb-utils >= 0.3,
+ syb,
hslogger >= 1.0,
AttoJson >= 0.5.8,
multiset >= 0.1 && < 0.3,
- time == 1.1.*,
+ time == 1.2.*,
uniplate ,
list-tries ,
binary == 0.5.*,
array >= 0.2 && < 0.4,
old-time == 1.0.*,
QuickCheck >= 2,
- HUnit
+ HUnit,
+ bytestring
- if flag(cabal_1_8)
+ if flag(cabal_1_10)
build-depends:
- Cabal >= 1.8,
+ Cabal >= 1.10,
hslogger >= 1.1
- cpp-options: -DCABAL_VERSION=108
+ cpp-options: -DCABAL_VERSION=110
else
- build-depends:
- Cabal == 1.6.*
- cpp-options: -DCABAL_VERSION=106
+ if flag(cabal_1_8)
+ build-depends:
+ Cabal >= 1.8,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=108
+ else
+ build-depends:
+ Cabal == 1.6.*
+ cpp-options: -DCABAL_VERSION=106
hs-source-dirs: lib
extensions: CPP, PatternGuards, DeriveDataTypeable
@@ -280,20 +337,26 @@ executable STypeNotes-test
main-is: STypesNotesTest.hs
build-depends:
base == 4.*,
- filepath == 1.1.*,
- ghc >= 6.10 && < 6.13,
+ filepath == 1.2.*,
+ ghc >= 7,
multiset >= 0.1 && < 0.3,
HUnit
- if flag(cabal_1_8)
+ if flag(cabal_1_10)
build-depends:
- Cabal >= 1.8,
+ Cabal >= 1.10,
hslogger >= 1.1
- cpp-options: -DCABAL_VERSION=108
+ cpp-options: -DCABAL_VERSION=110
else
- build-depends:
- Cabal == 1.6.*
- cpp-options: -DCABAL_VERSION=106
+ if flag(cabal_1_8)
+ build-depends:
+ Cabal >= 1.8,
+ hslogger >= 1.1
+ cpp-options: -DCABAL_VERSION=108
+ else
+ build-depends:
+ Cabal == 1.6.*
+ cpp-options: -DCABAL_VERSION=106
hs-source-dirs: lib
extensions: CPP, PatternGuards
View
17 server/Scion/Server/Commands.hs
@@ -35,7 +35,11 @@ import Scion.Inspect.Completions
import Scion.Cabal
import Scion.Ghc hiding ( (<+>) )
+#if __GLASGOW_HASKELL__ < 700
import DynFlags ( supportedLanguages, allFlags )
+#else
+import DynFlags ( supportedLanguagesAndExtensions, allFlags )
+#endif
import Exception
import FastString
import PprTyThing ( pprTypeForUser )
@@ -60,6 +64,11 @@ import Packages ( pkgIdMap )
import Distribution.InstalledPackageInfo
#endif
+#if __GLASGOW_HASKELL__ >= 700
+supportedLanguages :: [String]
+supportedLanguages = supportedLanguagesAndExtensions
+#endif
+
type KeepGoing = Bool
-- a scion request is JS object with 3 keys:
@@ -152,7 +161,7 @@ allCmds = M.fromList [ (cmdName c, c) | c <- allCommands ]
allCommands :: [Cmd]
allCommands =
[ cmdConnectionInfo
- , cmdListSupportedLanguages
+ , cmdListsupportedLanguages
, cmdListSupportedPragmas
, cmdListSupportedFlags
, cmdListCabalComponents
@@ -208,7 +217,9 @@ handleScionException m = ((((do
case e' of
Panic _ -> throw e'
InstallationError _ -> throw e'
+#if __GLASGOW_HASKELL__ < 700
Interrupted -> throw e'
+#endif
_ -> return (Error (show e')))
`gcatch` \(e :: ExitCode) ->
-- client code may not exit the server!
@@ -432,8 +443,8 @@ instance JSON OutlineDef where
fromJSON _ = fail "OutlineDef"
-cmdListSupportedLanguages :: Cmd
-cmdListSupportedLanguages = Cmd "list-supported-languages" $ noArgs cmd
+cmdListsupportedLanguages :: Cmd
+cmdListsupportedLanguages = Cmd "list-supported-languages" $ noArgs cmd
where cmd = return (map S.fromString supportedLanguages)
cmdListSupportedPragmas :: Cmd
Please sign in to comment.
Something went wrong with that request. Please try again.