diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 8220dc4..94536ee 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -255,6 +255,7 @@ readConditionContents single = do otherOp = try $ do id <- getNextId s <- readOp + when (s == "-a" || s == "-o") $ fail "Wrong operator" return $ TC_Binary id typ s readCondUnaryExp = do @@ -303,7 +304,6 @@ readConditionContents single = do softCondSpacing return $ TC_And id typ x - readCondOrOp = do id <- getNextId x <- try (string "||" <|> string "-o") @@ -584,6 +584,7 @@ prop_readCondition5b= isOk readCondition "[[ $c =~ f( ($var ]]) )* ]]" prop_readCondition6 = isOk readCondition "[[ $c =~ ^[yY]$ ]]" prop_readCondition7 = isOk readCondition "[[ ${line} =~ ^[[:space:]]*# ]]" prop_readCondition8 = isOk readCondition "[[ $l =~ ogg|flac ]]" +prop_readCondition9 = isOk readCondition "[ foo -a -f bar ]" readCondition = called "test expression" $ do opos <- getPosition id <- getNextId