diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist index 6f849c5..8915844 100644 --- a/Syntaxes/JavaScript.plist +++ b/Syntaxes/JavaScript.plist @@ -22,7 +22,12 @@ begin - (?x) (function) (?= (\s+ ([_$a-zA-Z][_$\w]*))? \s* \(.*?\)) + (?x) + (function) + (?= + (?:\s+ (?:[_$a-zA-Z][_$\w]*))? \s* # The function name + \([^)]*\) # The properties that the function accepts + ) beginCaptures 1 @@ -164,7 +169,7 @@ begin - (\{) + (?<!\))(\{) captures 1 @@ -205,6 +210,8 @@ punctuation.section.scope.round.js + disabled + 1 end (\)) name @@ -345,7 +352,10 @@ function-params begin - (?x)(?<=function) (?:\s+ ([_$a-zA-Z][_$\w]*))? \s* (\() + (?x) + (?<=function) # Must come after the word "function" + (?:\s+ ([_$a-zA-Z][_$\w]*))? # Mtch the name if it exists + \s* (\() beginCaptures 1