mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 22:35:54 +08:00
Fixed position of &; message
This commit is contained in:
@@ -603,8 +603,14 @@ prop_roflol = isWarning readScript "a &; b"
|
|||||||
prop_roflol2 = isOk readScript "a & b"
|
prop_roflol2 = isOk readScript "a & b"
|
||||||
readSeparatorOp = do
|
readSeparatorOp = do
|
||||||
notFollowedBy (g_AND_IF <|> g_DSEMI)
|
notFollowedBy (g_AND_IF <|> g_DSEMI)
|
||||||
f <- (try $ char '&' >> spacing >> char ';' >> parseProblem ErrorC "It's not 'foo &; bar', just 'foo & bar'. " >> return '&')
|
f <- (try $ do
|
||||||
<|> char ';' <|> char '&'
|
char '&'
|
||||||
|
spacing
|
||||||
|
pos <- getPosition
|
||||||
|
char ';'
|
||||||
|
parseProblemAt pos ErrorC "It's not 'foo &; bar', just 'foo & bar'. "
|
||||||
|
return '&'
|
||||||
|
) <|> char ';' <|> char '&'
|
||||||
spacing
|
spacing
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user