From 83c3dd341861ac2d3d925e6b83011cd0b67eb0be Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sun, 3 Nov 2013 13:58:06 -0800 Subject: [PATCH] Accept ./? in function names --- ShellCheck/Parser.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Parser.hs b/ShellCheck/Parser.hs index 8208979..9b4b3b7 100644 --- a/ShellCheck/Parser.hs +++ b/ShellCheck/Parser.hs @@ -42,7 +42,7 @@ singleQuote = char '\'' <|> unicodeSingleQuote doubleQuote = char '"' <|> unicodeDoubleQuote variableStart = upper <|> lower <|> oneOf "_" variableChars = upper <|> lower <|> digit <|> oneOf "_" -functionChars = variableChars <|> oneOf ":+-" +functionChars = variableChars <|> oneOf ":+-.?" specialVariable = oneOf "@*#?-$!" tokenDelimiter = oneOf "&|;<> \t\n\r" <|> nbsp quotable = oneOf "|&;<>()$`\\ \"'\t\n\r" <|> nbsp <|> unicodeDoubleQuote @@ -1472,6 +1472,8 @@ prop_readFunctionDefinition2 = isWarning readFunctionDefinition "function foo() prop_readFunctionDefinition3 = isWarning readFunctionDefinition "function foo { lol; }" prop_readFunctionDefinition4 = isWarning readFunctionDefinition "foo(a, b) { true; }" prop_readFunctionDefinition5 = isOk readFunctionDefinition ":(){ :|:;}" +prop_readFunctionDefinition6 = isOk readFunctionDefinition "?(){ foo; }" +prop_readFunctionDefinition7 = isOk readFunctionDefinition "..(){ cd ..; }" readFunctionDefinition = called "function" $ do id <- getNextId name <- try readFunctionSignature