From fdce0116da64a3aeb5b61d152e05bf1d61c59585 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 13 May 2014 19:20:34 -0700 Subject: [PATCH] Fix parsing {} in regex --- ShellCheck/Parser.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 592380b..5ef6c3b 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -408,7 +408,7 @@ readConditionContents single = do where readGlobLiteral = do id <- getNextId - s <- many1 (extglobStart <|> oneOf "[]$") + s <- many1 (extglobStart <|> oneOf "{}[]$") return $ T_Literal id s readGroup = called "regex grouping" $ do id <- getNextId @@ -637,6 +637,7 @@ prop_readCondition9 = isOk readCondition "[ foo -a -f bar ]" prop_readCondition10= isOk readCondition "[[ a == b \n || c == d ]]" prop_readCondition11= isOk readCondition "[[ a == b || \n c == d ]]" prop_readCondition12= isWarning readCondition "[ a == b \n -o c == d ]" +prop_readCondition13= isOk readCondition "[[ foo =~ ^fo{1,3}$ ]]" readCondition = called "test expression" $ do opos <- getPosition id <- getNextId