mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-13 22:57:01 +08:00
Also warn about missing 'then' before 'else'
This commit is contained in:
@@ -1672,7 +1672,7 @@ readIfPart = do
|
|||||||
allspacing
|
allspacing
|
||||||
condition <- readTerm
|
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'?"
|
parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'if'?"
|
||||||
|
|
||||||
called "then clause" $ do
|
called "then clause" $ do
|
||||||
@@ -1695,7 +1695,7 @@ readElifPart = called "elif clause" $ do
|
|||||||
allspacing
|
allspacing
|
||||||
condition <- readTerm
|
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'?"
|
parseProblemAt pos ErrorC 1049 "Did you forget the 'then' for this 'elif'?"
|
||||||
|
|
||||||
g_Then
|
g_Then
|
||||||
|
Reference in New Issue
Block a user