Added error for cat << (foo)
This commit is contained in:
parent
5d408875f1
commit
8cf899300d
|
@ -735,10 +735,15 @@ readHereDoc = do
|
||||||
let stripLiteral (T_Literal _ x) = x
|
let stripLiteral (T_Literal _ x) = x
|
||||||
stripLiteral (T_SingleQuoted _ x) = x
|
stripLiteral (T_SingleQuoted _ x) = x
|
||||||
fid <- getNextId
|
fid <- getNextId
|
||||||
|
pos <- getPosition
|
||||||
try $ string "<<"
|
try $ string "<<"
|
||||||
dashed <- (char '-' >> return True) <|> return False
|
dashed <- (char '-' >> return True) <|> return False
|
||||||
tokenPosition <- getPosition
|
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
|
hid <- getNextId
|
||||||
(quoted, endToken) <- (readNormalLiteral >>= (\x -> return (False, stripLiteral x)) )
|
(quoted, endToken) <- (readNormalLiteral >>= (\x -> return (False, stripLiteral x)) )
|
||||||
<|> (readDoubleQuotedLiteral >>= return . (\x -> (True, stripLiteral x)))
|
<|> (readDoubleQuotedLiteral >>= return . (\x -> (True, stripLiteral x)))
|
||||||
|
|
Loading…
Reference in New Issue