mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 01:59:27 +08:00
Parse single/double quoted literals in arithmetic context
This commit is contained in:
@@ -344,6 +344,7 @@ prop_a8 = isOk readArithmeticContents "3"
|
|||||||
prop_a9 = isOk readArithmeticContents "a^!-b"
|
prop_a9 = isOk readArithmeticContents "a^!-b"
|
||||||
prop_aA = isOk readArithmeticContents "! $?"
|
prop_aA = isOk readArithmeticContents "! $?"
|
||||||
prop_aB = isOk readArithmeticContents "10#08 * 16#f"
|
prop_aB = isOk readArithmeticContents "10#08 * 16#f"
|
||||||
|
prop_aC = isOk readArithmeticContents "\"$((3+2))\" + '37'"
|
||||||
readArithmeticContents =
|
readArithmeticContents =
|
||||||
readSequence
|
readSequence
|
||||||
where
|
where
|
||||||
@@ -410,7 +411,9 @@ readArithmeticContents =
|
|||||||
oct = string "0"
|
oct = string "0"
|
||||||
|
|
||||||
readArithTerm = readBased <|> readArithTermUnit
|
readArithTerm = readBased <|> readArithTermUnit
|
||||||
readArithTermUnit = readGroup <|> readExpansion <|> readNumber <|> readVar
|
readArithTermUnit = readGroup <|> readExpansion <|> readQuoted <|> readNumber <|> readVar
|
||||||
|
|
||||||
|
readQuoted = readDoubleQuoted <|> readSingleQuoted
|
||||||
|
|
||||||
readSequence = do
|
readSequence = do
|
||||||
spacing
|
spacing
|
||||||
|
Reference in New Issue
Block a user