From 7c18ecee4fada559f352c240a6130a1547349761 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Mon, 14 Jan 2013 21:52:09 -0800 Subject: [PATCH] Parse single/double quoted literals in arithmetic context --- ShellCheck/Parser.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index c2d57d3..6a15460 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -344,6 +344,7 @@ prop_a8 = isOk readArithmeticContents "3" prop_a9 = isOk readArithmeticContents "a^!-b" prop_aA = isOk readArithmeticContents "! $?" prop_aB = isOk readArithmeticContents "10#08 * 16#f" +prop_aC = isOk readArithmeticContents "\"$((3+2))\" + '37'" readArithmeticContents = readSequence where @@ -410,7 +411,9 @@ readArithmeticContents = oct = string "0" readArithTerm = readBased <|> readArithTermUnit - readArithTermUnit = readGroup <|> readExpansion <|> readNumber <|> readVar + readArithTermUnit = readGroup <|> readExpansion <|> readQuoted <|> readNumber <|> readVar + + readQuoted = readDoubleQuoted <|> readSingleQuoted readSequence = do spacing