mirror of
https://github.com/koalaman/shellcheck
synced 2025-08-20 13:23:55 -07:00
Warn against open parenthesis in normal words
This commit is contained in:
parent
84f87002b7
commit
899d9eb445
1 changed files with 11 additions and 1 deletions
|
@ -541,7 +541,17 @@ checkPossibleTermination pos [T_Literal _ x] =
|
||||||
else return ()
|
else return ()
|
||||||
checkPossibleTermination _ _ = return ()
|
checkPossibleTermination _ _ = return ()
|
||||||
|
|
||||||
readNormalWordPart end = readSingleQuoted <|> readDoubleQuoted <|> readGlob <|> readDollar <|> readBraced <|> readBackTicked <|> readProcSub <|> (readNormalLiteral end)
|
readNormalWordPart end = do
|
||||||
|
checkForParenthesis
|
||||||
|
readSingleQuoted <|> readDoubleQuoted <|> readGlob <|> readDollar <|> readBraced <|> readBackTicked <|> readProcSub <|> (readNormalLiteral end)
|
||||||
|
where
|
||||||
|
checkForParenthesis = do
|
||||||
|
return () `attempting` do
|
||||||
|
pos <- getPosition
|
||||||
|
lookAhead $ char '('
|
||||||
|
parseProblemAt pos ErrorC "'(' is invalid here. Did you forget to escape it?"
|
||||||
|
|
||||||
|
|
||||||
readSpacePart = do
|
readSpacePart = do
|
||||||
id <- getNextId
|
id <- getNextId
|
||||||
x <- many1 whitespace
|
x <- many1 whitespace
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue