mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-30 19:40:40 -07:00
Also warn about missing 'then' before 'else'
This commit is contained in:
parent
a01862bc12
commit
73cd2cdd6f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue