Merge ad1d5fa64f
into d3001f337a
This commit is contained in:
commit
89ffae0c18
|
@ -66,10 +66,14 @@ singleQuote = char '\''
|
|||
doubleQuote = char '"'
|
||||
variableStart = upper <|> lower <|> oneOf "_"
|
||||
variableChars = upper <|> lower <|> digit <|> oneOf "_"
|
||||
-- Chars to allow in function names
|
||||
functionChars = variableChars <|> oneOf ":+?-./^@,"
|
||||
-- Chars to allow function names to start with
|
||||
functionStartChars = variableChars <|> oneOf ":+?-./^@,"
|
||||
-- Chars to allow inside function names
|
||||
functionChars = variableChars <|> oneOf "#:+?-./^@,"
|
||||
-- Chars to allow function names to start with, using the 'function' keyword
|
||||
extendedFunctionStartChars = functionStartChars <|> oneOf "[]*=!"
|
||||
-- Chars to allow in functions using the 'function' keyword
|
||||
extendedFunctionChars = functionChars <|> oneOf "[]*=!"
|
||||
extendedFunctionChars = extendedFunctionStartChars <|> oneOf "[]*=!"
|
||||
specialVariable = oneOf (concat specialVariables)
|
||||
paramSubSpecialChars = oneOf "/:+-=%"
|
||||
quotableChars = "|&;<>()\\ '\t\n\r\xA0" ++ doubleQuotableChars
|
||||
|
@ -2768,7 +2772,7 @@ readFunctionDefinition = called "function" $ do
|
|||
string "function"
|
||||
whitespace
|
||||
spacing
|
||||
name <- many1 extendedFunctionChars
|
||||
name <- (:) <$> extendedFunctionStartChars <*> many extendedFunctionChars
|
||||
spaces <- spacing
|
||||
hasParens <- wasIncluded readParens
|
||||
when (not hasParens && null spaces) $
|
||||
|
@ -2777,7 +2781,7 @@ readFunctionDefinition = called "function" $ do
|
|||
return $ \id -> T_Function id (FunctionKeyword True) (FunctionParentheses hasParens) name
|
||||
|
||||
readWithoutFunction = try $ do
|
||||
name <- many1 functionChars
|
||||
name <- (:) <$> functionStartChars <*> many functionChars
|
||||
guard $ name /= "time" -- Interferes with time ( foo )
|
||||
spacing
|
||||
readParens
|
||||
|
|
Loading…
Reference in New Issue