mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-14 23:37:01 +08:00
Parse double arithmetic negation, i.e. (( !!a ));
This commit is contained in:
@@ -555,6 +555,7 @@ prop_a18= isOk readArithmeticContents "a?b:c"
|
|||||||
prop_a19= isOk readArithmeticContents "\\\n3 +\\\n 2"
|
prop_a19= isOk readArithmeticContents "\\\n3 +\\\n 2"
|
||||||
prop_a20= isOk readArithmeticContents "a ? b ? c : d : e"
|
prop_a20= isOk readArithmeticContents "a ? b ? c : d : e"
|
||||||
prop_a21= isOk readArithmeticContents "a ? b : c ? d : e"
|
prop_a21= isOk readArithmeticContents "a ? b : c ? d : e"
|
||||||
|
prop_a22= isOk readArithmeticContents "!!a"
|
||||||
readArithmeticContents =
|
readArithmeticContents =
|
||||||
readSequence
|
readSequence
|
||||||
where
|
where
|
||||||
@@ -650,7 +651,7 @@ readArithmeticContents =
|
|||||||
id <- getNextId
|
id <- getNextId
|
||||||
op <- oneOf "!~"
|
op <- oneOf "!~"
|
||||||
spacing
|
spacing
|
||||||
x <- readAnySigned
|
x <- readAnyNegated
|
||||||
return $ TA_Unary id [op] x
|
return $ TA_Unary id [op] x
|
||||||
|
|
||||||
readAnySigned = readSigned <|> readAnycremented
|
readAnySigned = readSigned <|> readAnycremented
|
||||||
|
Reference in New Issue
Block a user