mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 12:30:52 +08:00
Parser support for $[..], plus deprecation warning.
This commit is contained in:
@@ -843,7 +843,7 @@ readBraced = try $ do
|
||||
|
||||
readNormalDollar = readDollarExpression <|> readDollarLonely <|> readDollarDoubleQuote
|
||||
readDoubleQuotedDollar = readDollarExpression <|> readDollarLonely
|
||||
readDollarExpression = readDollarArithmetic <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable <|> readDollarSingleQuote
|
||||
readDollarExpression = readDollarArithmetic <|> readDollarBracket <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable <|> readDollarSingleQuote
|
||||
|
||||
prop_readDollarSingleQuote = isOk readDollarSingleQuote "$'foo\\\'lol'"
|
||||
readDollarSingleQuote = called "$'..' expression" $ do
|
||||
@@ -873,6 +873,13 @@ readDollarArithmetic = called "$((..)) expression" $ do
|
||||
string "))"
|
||||
return (T_DollarArithmetic id c)
|
||||
|
||||
readDollarBracket = called "$[..] expression" $ do
|
||||
id <- getNextId
|
||||
try (string "$[")
|
||||
c <- readArithmeticContents
|
||||
string "]"
|
||||
return (T_DollarBracket id c)
|
||||
|
||||
readArithmeticExpression = called "((..)) command" $ do
|
||||
id <- getNextId
|
||||
try (string "((")
|
||||
|
Reference in New Issue
Block a user