From c808c9b6fe1487bfe1a0549ee400fd408be5405a Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 3 Sep 2015 20:58:21 -0700 Subject: [PATCH] End here doc tokens on < and >. --- ShellCheck/Parser.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index da83722..2c1cccb 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -1307,6 +1307,7 @@ prop_readHereDoc4 = isOk readHereDoc "<< foo\n`\nfoo" prop_readHereDoc5 = isOk readHereDoc "<<- !foo\nbar\n!foo" prop_readHereDoc6 = isOk readHereDoc "<< foo\\ bar\ncow\nfoo bar" prop_readHereDoc7 = isOk readHereDoc "<< foo\n\\$(f ())\nfoo" +prop_readHereDoc8 = isOk readHereDoc "<>bar\netc\nfoo" readHereDoc = called "here document" $ do fid <- getNextId pos <- getPosition @@ -1349,7 +1350,7 @@ readHereDoc = called "here document" $ do liftM concat $ many1 (escaped <|> quoted <|> normal) where quoted = liftM stripLiteral readDoubleQuotedLiteral <|> readSingleQuotedLiteral - normal = anyChar `reluctantlyTill1` (whitespace <|> oneOf ";&)'\"\\") + normal = anyChar `reluctantlyTill1` (whitespace <|> oneOf "<>;&)'\"\\") escaped = do -- surely the user must be doing something wrong at this point char '\\' c <- anyChar