mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 11:14:25 +08:00
Fix #949 (failing on @ in function names)
'@' was previously mentioned in 5005dc0fa1
as a
character needed to fix #909, but was not included
in the actual change at that time.
This commit is contained in:
@@ -66,7 +66,7 @@ doubleQuote = char '"'
|
||||
variableStart = upper <|> lower <|> oneOf "_"
|
||||
variableChars = upper <|> lower <|> digit <|> oneOf "_"
|
||||
-- Chars to allow in function names
|
||||
functionChars = variableChars <|> oneOf ":+?-./^"
|
||||
functionChars = variableChars <|> oneOf ":+?-./^@"
|
||||
-- Chars to allow in functions using the 'function' keyword
|
||||
extendedFunctionChars = functionChars <|> oneOf "[]*=!"
|
||||
specialVariable = oneOf "@*#?-$!"
|
||||
@@ -2499,6 +2499,7 @@ prop_readFunctionDefinition9 = isOk readFunctionDefinition "function foo { true;
|
||||
prop_readFunctionDefinition10= isOk readFunctionDefinition "function foo () { true; }"
|
||||
prop_readFunctionDefinition11= isWarning readFunctionDefinition "function foo{\ntrue\n}"
|
||||
prop_readFunctionDefinition12= isOk readFunctionDefinition "function []!() { true; }"
|
||||
prop_readFunctionDefinition13= isOk readFunctionDefinition "@require(){ true; }"
|
||||
readFunctionDefinition = called "function" $ do
|
||||
start <- startSpan
|
||||
functionSignature <- try readFunctionSignature
|
||||
|
Reference in New Issue
Block a user