From 01c27dc96aedcf2e1a4421685ec654613e137440 Mon Sep 17 00:00:00 2001 From: Vidar Holen <spam@vidarholen.net> Date: Wed, 2 Sep 2015 19:31:22 -0700 Subject: [PATCH] Parse double arithmetic negation, i.e. (( !!a )); --- ShellCheck/Parser.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index f06a51e..dd5d77e 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -555,6 +555,7 @@ prop_a18= isOk readArithmeticContents "a?b:c" prop_a19= isOk readArithmeticContents "\\\n3 +\\\n 2" prop_a20= isOk readArithmeticContents "a ? b ? c : d : e" prop_a21= isOk readArithmeticContents "a ? b : c ? d : e" +prop_a22= isOk readArithmeticContents "!!a" readArithmeticContents = readSequence where @@ -650,7 +651,7 @@ readArithmeticContents = id <- getNextId op <- oneOf "!~" spacing - x <- readAnySigned + x <- readAnyNegated return $ TA_Unary id [op] x readAnySigned = readSigned <|> readAnycremented