From 8a3bd25f7c4c6e00ab76cbdc471e5f8be1ba8b00 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 7 Feb 2016 14:16:40 -0800 Subject: [PATCH] Improve error for missing final ) in $((foo) --- ShellCheck/Parser.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index a4878aa..bf8e4a2 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -1255,7 +1255,9 @@ readDollarArithmetic = called "$((..)) expression" $ do id <- getNextId try (string "$((") c <- readArithmeticContents - string "))" + pos <- getPosition + char ')' + char ')' <|> fail "Expected a double )) to end the $((..))" return (T_DollarArithmetic id c) readDollarBracket = called "$[..] expression" $ do