mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 02:31:17 +08:00
Fixed parser bug where }> wasn't recognized as Rbrace
This commit is contained in:
@@ -1504,10 +1504,11 @@ readFunctionSignature = do
|
||||
readPattern = (readNormalWord `thenSkip` spacing) `sepBy1` (char '|' `thenSkip` spacing)
|
||||
|
||||
|
||||
prop_readCompoundCommand = isOk readCompoundCommand "{ echo foo; }>/dev/null"
|
||||
readCompoundCommand = do
|
||||
id <- getNextId
|
||||
cmd <- choice [ readBraceGroup, readArithmeticExpression, readSubshell, readCondition, readWhileClause, readUntilClause, readIfClause, readForClause, readSelectClause, readCaseClause, readFunctionDefinition]
|
||||
spacing
|
||||
optional spacing
|
||||
redirs <- many readIoRedirect
|
||||
when (not . null $ redirs) $ optional $ do
|
||||
lookAhead $ try (spacing >> needsSeparator)
|
||||
@@ -1647,7 +1648,8 @@ g_Semi = do
|
||||
notFollowedBy2 g_DSEMI
|
||||
tryToken ";" T_Semi
|
||||
|
||||
keywordSeparator = eof <|> disregard whitespace <|> (disregard $ oneOf ";()[")
|
||||
keywordSeparator =
|
||||
eof <|> disregard whitespace <|> (disregard $ oneOf ";()[<>&")
|
||||
|
||||
readKeyword = choice [ g_Then, g_Else, g_Elif, g_Fi, g_Do, g_Done, g_Esac, g_Rbrace, g_Rparen, g_DSEMI ]
|
||||
|
||||
|
Reference in New Issue
Block a user