From 73cd2cdd6f917ff8cb6489ae7de6424604a58c43 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Wed, 19 Aug 2015 20:27:14 -0700 Subject: [PATCH] Also warn about missing 'then' before 'else' --- ShellCheck/Parser.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index f13002d..5a1b806 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -1672,7 +1672,7 @@ readIfPart = do allspacing condition <- readTerm - ifNextToken (g_Fi <|> g_Elif) $ + ifNextToken (g_Fi <|> g_Elif <|> g_Else) $ parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'if'?" called "then clause" $ do @@ -1695,7 +1695,7 @@ readElifPart = called "elif clause" $ do allspacing condition <- readTerm - ifNextToken (g_Fi <|> g_Elif) $ + ifNextToken (g_Fi <|> g_Elif <|> g_Else) $ parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'elif'?" g_Then