mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-11 23:56:30 -07:00
Warn about 'while!' and 'while:'
This commit is contained in:
parent
d8717c7046
commit
6d257bfa17
1 changed files with 8 additions and 5 deletions
|
@ -2582,11 +2582,14 @@ tryParseWordToken keyword t = try $ do
|
||||||
str <- anycaseString keyword
|
str <- anycaseString keyword
|
||||||
|
|
||||||
optional $ do
|
optional $ do
|
||||||
try . lookAhead $ char '['
|
c <- try . lookAhead $ anyChar
|
||||||
parseProblem ErrorC 1069 "You need a space before the [."
|
let warning code = parseProblem ErrorC code $ "You need a space before the " ++ [c] ++ "."
|
||||||
optional $ do
|
case c of
|
||||||
try . lookAhead $ char '#'
|
'[' -> warning 1069
|
||||||
parseProblem ErrorC 1099 "You need a space before the #."
|
'#' -> warning 1099
|
||||||
|
'!' -> warning 1129
|
||||||
|
':' -> warning 1130
|
||||||
|
_ -> return ()
|
||||||
|
|
||||||
lookAhead keywordSeparator
|
lookAhead keywordSeparator
|
||||||
when (str /= keyword) $
|
when (str /= keyword) $
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue