Skip to content

Commit

Permalink
Merge pull request #35 from spwhitton/src-exts-1.18
Browse files Browse the repository at this point in the history
fix build with haskell-src-exts 1.18.2 / 1.19.1
  • Loading branch information
luqui authored Mar 26, 2018
2 parents 1c32136 + dd1fa03 commit f28c34e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Main where

import Options.Applicative
import qualified Language.Haskell.Exts.Annotated as L
import qualified Language.Haskell.Exts as L
import System.IO
import GHC.IO.Handle (HandlePosition)
import qualified Data.Map.Strict as Map
Expand All @@ -30,7 +30,7 @@ localDecls :: L.Module L.SrcSpanInfo -> Map.Map String Defn
localDecls (L.Module _ _ _ _ decls) = Map.fromList $ concatMap extract decls
where
extract (L.TypeDecl _ hd _) = extractDeclHead hd
extract (L.TypeFamDecl _ hd _) = extractDeclHead hd
extract (L.TypeFamDecl _ hd _ _) = extractDeclHead hd
extract (L.DataDecl _ _ _ hd decls' _) =
extractDeclHead hd ++ concatMap extractQualConDecl decls'
extract (L.GDataDecl _ _ _ hd _ decls' _) =
Expand Down Expand Up @@ -73,7 +73,7 @@ localDecls (L.Module _ _ _ _ decls) = Map.fromList $ concatMap extract decls

extractClassDecl (L.ClsDecl _ decl) = extract decl
extractClassDecl (L.ClsDataFam _ _ hd _) = extractDeclHead hd
extractClassDecl (L.ClsTyFam _ hd _) = extractDeclHead hd
extractClassDecl (L.ClsTyFam _ hd _ _) = extractDeclHead hd
extractClassDecl _ = []

extractName (L.Ident loc name) = [(name, getLoc loc)]
Expand Down Expand Up @@ -134,9 +134,7 @@ exported mod'@(L.Module _
where
matchesSpec nm (L.EVar _ (L.UnQual _ (L.Ident _ name'))) = nm == name'
matchesSpec nm (L.EAbs _ _ (L.UnQual _ (L.Ident _ name'))) = nm == name'
matchesSpec nm (L.EThingAll _ (L.UnQual _ (L.Ident _ name'))) =
nm == name' || (nm `elem` thingMembers mod' name')
matchesSpec nm (L.EThingWith _ (L.UnQual _ (L.Ident _ name')) cnames) =
matchesSpec nm (L.EThingWith _ _ (L.UnQual _ (L.Ident _ name')) cnames) =
nm == name' || any (matchesCName nm) cnames
-- XXX this is wrong, moduleScope handles it though
matchesSpec _ (L.EModuleContents _ (L.ModuleName _ _)) = False
Expand Down
2 changes: 1 addition & 1 deletion hothasktags.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ executable hothasktags
filepath,
filemanip,
Glob,
haskell-src-exts >= 1.17 && < 1.18,
haskell-src-exts >= 1.18.2 && < 1.20,
cpphs >= 1.11 && < 1.21,
optparse-applicative >= 0.13,
split
Expand Down

0 comments on commit f28c34e

Please sign in to comment.