Added error for cat << (foo)
This commit is contained in:
parent
5d408875f1
commit
8cf899300d
ShellCheck
|
@ -735,10 +735,15 @@ readHereDoc = do
|
|||
let stripLiteral (T_Literal _ x) = x
|
||||
stripLiteral (T_SingleQuoted _ x) = x
|
||||
fid <- getNextId
|
||||
pos <- getPosition
|
||||
try $ string "<<"
|
||||
dashed <- (char '-' >> return True) <|> return False
|
||||
tokenPosition <- getPosition
|
||||
spacing
|
||||
sp <- spacing
|
||||
optional $ do
|
||||
try . lookAhead $ char '('
|
||||
let message = "Shells are space sensitive. Use '< <(cmd)', not '<<" ++ sp ++ "(cmd)'."
|
||||
parseProblemAt pos ErrorC message
|
||||
hid <- getNextId
|
||||
(quoted, endToken) <- (readNormalLiteral >>= (\x -> return (False, stripLiteral x)) )
|
||||
<|> (readDoubleQuotedLiteral >>= return . (\x -> (True, stripLiteral x)))
|
||||
|
|
Loading…
Reference in New Issue