mirror of
https://github.com/kennethreitz-archive/kJS.tmbundle.git
synced 2026-06-05 23:50:19 +00:00
Tweaking regex for optimization and performance. disabling "punctuation.section.scope.round" seems to have helped.
git-svn-id: http://macromates.com/svn/Bundles/trunk/Review/Bundles/JavaScript.tmbundle@9130 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
This commit is contained in:
@@ -22,7 +22,12 @@
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?x) (function) (?= (\s+ ([_$a-zA-Z][_$\w]*))? \s* \(.*?\))</string>
|
||||
<string>(?x)
|
||||
(function)
|
||||
(?=
|
||||
(?:\s+ (?:[_$a-zA-Z][_$\w]*))? \s* # The function name
|
||||
\([^)]*\) # The properties that the function accepts
|
||||
)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
@@ -164,7 +169,7 @@
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(\{)</string>
|
||||
<string>(?<!\))(\{)</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
@@ -205,6 +210,8 @@
|
||||
<string>punctuation.section.scope.round.js</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>disabled</key>
|
||||
<integer>1</integer>
|
||||
<key>end</key>
|
||||
<string>(\))</string>
|
||||
<key>name</key>
|
||||
@@ -345,7 +352,10 @@
|
||||
<key>function-params</key>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?x)(?<=function) (?:\s+ ([_$a-zA-Z][_$\w]*))? \s* (\()</string>
|
||||
<string>(?x)
|
||||
(?<=function) # Must come after the word "function"
|
||||
(?:\s+ ([_$a-zA-Z][_$\w]*))? # Mtch the name if it exists
|
||||
\s* (\()</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
||||
Reference in New Issue
Block a user