Fixed incorrect parsing of [ foo -a -f bar ]

This commit is contained in:
Vidar Holen 2013-11-24 18:49:49 -08:00
parent d603ee1e89
commit 1011ae7b3c
1 changed files with 2 additions and 1 deletions

View File

@ -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