mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 01:59:27 +08:00
Don't try to parse $'..' in ""
This commit is contained in:
@@ -692,6 +692,7 @@ readBackTicked = called "backtick expansion" $ do
|
||||
|
||||
|
||||
prop_readDoubleQuoted = isOk readDoubleQuoted "\"Hello $FOO\""
|
||||
prop_readDoubleQuoted2 = isOk readDoubleQuoted "\"$'\""
|
||||
readDoubleQuoted = called "double quoted string" $ do
|
||||
id <- getNextId
|
||||
doubleQuote
|
||||
@@ -846,9 +847,9 @@ readBraced = try $ do
|
||||
char '}'
|
||||
return $ T_BraceExpansion id $ concat str
|
||||
|
||||
readNormalDollar = readDollarExpression <|> readDollarLonely <|> readDollarDoubleQuote
|
||||
readNormalDollar = readDollarExpression <|> readDollarLonely <|> readDollarDoubleQuote <|> readDollarSingleQuote
|
||||
readDoubleQuotedDollar = readDollarExpression <|> readDollarLonely
|
||||
readDollarExpression = readDollarArithmetic <|> readDollarBracket <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable <|> readDollarSingleQuote
|
||||
readDollarExpression = readDollarArithmetic <|> readDollarBracket <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable
|
||||
|
||||
prop_readDollarSingleQuote = isOk readDollarSingleQuote "$'foo\\\'lol'"
|
||||
readDollarSingleQuote = called "$'..' expression" $ do
|
||||
|
Reference in New Issue
Block a user