Don't try to parse $'..' in ""

This commit is contained in:
Vidar Holen 2013-07-10 17:41:38 -07:00
parent 3832ca9d5c
commit e6f2ee1f88
1 changed files with 3 additions and 2 deletions

View File

@ -692,6 +692,7 @@ readBackTicked = called "backtick expansion" $ do
prop_readDoubleQuoted = isOk readDoubleQuoted "\"Hello $FOO\"" prop_readDoubleQuoted = isOk readDoubleQuoted "\"Hello $FOO\""
prop_readDoubleQuoted2 = isOk readDoubleQuoted "\"$'\""
readDoubleQuoted = called "double quoted string" $ do readDoubleQuoted = called "double quoted string" $ do
id <- getNextId id <- getNextId
doubleQuote doubleQuote
@ -846,9 +847,9 @@ readBraced = try $ do
char '}' char '}'
return $ T_BraceExpansion id $ concat str return $ T_BraceExpansion id $ concat str
readNormalDollar = readDollarExpression <|> readDollarLonely <|> readDollarDoubleQuote readNormalDollar = readDollarExpression <|> readDollarLonely <|> readDollarDoubleQuote <|> readDollarSingleQuote
readDoubleQuotedDollar = readDollarExpression <|> readDollarLonely readDoubleQuotedDollar = readDollarExpression <|> readDollarLonely
readDollarExpression = readDollarArithmetic <|> readDollarBracket <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable <|> readDollarSingleQuote readDollarExpression = readDollarArithmetic <|> readDollarBracket <|> readDollarBraced <|> readDollarExpansion <|> readDollarVariable
prop_readDollarSingleQuote = isOk readDollarSingleQuote "$'foo\\\'lol'" prop_readDollarSingleQuote = isOk readDollarSingleQuote "$'foo\\\'lol'"
readDollarSingleQuote = called "$'..' expression" $ do readDollarSingleQuote = called "$'..' expression" $ do