mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-20 13:23:55 -07:00
Added a check for spurious }s
This commit is contained in:
parent
d58bd400ea
commit
21262399cc
1 changed files with 7 additions and 0 deletions
|
@ -450,8 +450,15 @@ prop_readNormalWord2 = isOk readNormalWord "foo**(foo)!!!(@@(bar))"
|
||||||
readNormalWord = do
|
readNormalWord = do
|
||||||
id <- getNextId
|
id <- getNextId
|
||||||
x <- many1 readNormalWordPart
|
x <- many1 readNormalWordPart
|
||||||
|
checkPossibleTermination x
|
||||||
return $ T_NormalWord id x
|
return $ T_NormalWord id x
|
||||||
|
|
||||||
|
|
||||||
|
checkPossibleTermination [T_Literal _ "}"] =
|
||||||
|
parseProblem WarningC "If you meant to terminate a {} block, you need a semicolon or linefeed before the }."
|
||||||
|
checkPossibleTermination _ = return ()
|
||||||
|
|
||||||
|
|
||||||
readNormalWordPart = readSingleQuoted <|> readDoubleQuoted <|> readExtglob <|> readDollar <|> readBraced <|> readBackTicked <|> (readNormalLiteral)
|
readNormalWordPart = readSingleQuoted <|> readDoubleQuoted <|> readExtglob <|> readDollar <|> readBraced <|> readBackTicked <|> (readNormalLiteral)
|
||||||
readSpacePart = do
|
readSpacePart = do
|
||||||
id <- getNextId
|
id <- getNextId
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue