summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVidar Holen <vidar@vidarholen.net>2018-10-04 20:11:40 -0700
committerGitHub <noreply@github.com>2018-10-04 20:11:40 -0700
commit79319558a59741e9075ad3353cca8fea194d5f83 (patch)
tree30c9dedac6b70ccaee569f1a4156d22e677218b9
parent8d13add1eddeaf6111d1fa539a8977f45d5cbdb6 (diff)
parent8940e60300317fc8c5a3ff6ddfaf622029e82cde (diff)
Merge pull request #1350 from peti/master
Fix build with ghc 8.6.1
-rw-r--r--ShellCheck.cabal2
-rw-r--r--src/ShellCheck/AnalyzerLib.hs7
2 files changed, 5 insertions, 4 deletions
diff --git a/ShellCheck.cabal b/ShellCheck.cabal
index 9993ba9..8956ff5 100644
--- a/ShellCheck.cabal
+++ b/ShellCheck.cabal
@@ -35,7 +35,7 @@ custom-setup
setup-depends:
base >= 4 && <5,
process >= 1.0 && <1.7,
- Cabal >= 1.10 && <2.3
+ Cabal >= 1.10 && <2.5
source-repository head
type: git
diff --git a/src/ShellCheck/AnalyzerLib.hs b/src/ShellCheck/AnalyzerLib.hs
index 5820cc7..de3498d 100644
--- a/src/ShellCheck/AnalyzerLib.hs
+++ b/src/ShellCheck/AnalyzerLib.hs
@@ -240,9 +240,10 @@ getParentTree t =
where
pre t = modify (first ((:) t))
post t = do
- (_:rest, map) <- get
- case rest of [] -> put (rest, map)
- (x:_) -> put (rest, Map.insert (getId t) x map)
+ (x, map) <- get
+ case x of
+ _:rest -> case rest of [] -> put (rest, map)
+ (x:_) -> put (rest, Map.insert (getId t) x map)
-- Given a root node, make a map from Id to Token
getTokenMap :: Token -> Map.Map Id Token