From 29989a44d7cddbbd6ddb5806bf64fd57594ad00c Mon Sep 17 00:00:00 2001 From: duff Date: Tue, 20 Mar 2007 11:51:44 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20change=20several=20patterns=20of=20?= =?UTF-8?q?the=20form:=20[A-Za-z=E2=80=A6]+\w*=20into=20[A-Za-z=E2=80=A6][?= =?UTF-8?q?\w=E2=80=A6]*=20=E2=80=94=20I=20am=20thinking=20though,=20that?= =?UTF-8?q?=20=E2=80=98=E2=80=A6=E2=80=99=20should=20not=20be=20allowed=20?= =?UTF-8?q?for=20anything=20but=20the=20first=20character=20=E2=80=A2=20ch?= =?UTF-8?q?ange=20a=20pattern=20of=20the=20fork:=20\w+=20\.=3F=20\w*=20int?= =?UTF-8?q?o=20\w+=20(\.=20\w*)=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both of the above would previously result in potential really bad performance, because two greedy repeats basically matching the same thing, was after each other, and that leads to exponential time complexity in input size. git-svn-id: http://macromates.com/svn/Bundles/trunk/Bundles/JavaScript.tmbundle@6859 dfb7d73b-c2ec-0310-8fea-fb051d288c6d --- Syntaxes/JavaScript.plist | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Syntaxes/JavaScript.plist b/Syntaxes/JavaScript.plist index ac64115..9785580 100644 --- a/Syntaxes/JavaScript.plist +++ b/Syntaxes/JavaScript.plist @@ -36,7 +36,7 @@ comment match stuff like: Sound.prototype = { … } when extending an object match - ([a-zA-Z_?\.$]+\w*)\.(prototype)\s*=\s* + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\s*=\s* name meta.class.js @@ -82,7 +82,7 @@ comment match stuff like: Sound.prototype.play = function() { … } match - ([a-zA-Z_?\.$]+\w*)\.(prototype)\.([a-zA-Z_?\.$]+\w*)\s*=\s*(function)?\s*(\()(.*?)(\)) + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\.([a-zA-Z_?.$][\w?.$]*)\s*=\s*(function)?\s*(\()(.*?)(\)) name meta.function.prototype.js @@ -108,7 +108,7 @@ comment match stuff like: Sound.prototype.play = myfunc match - ([a-zA-Z_?\.\$]+\w*)\.(prototype)\.([a-zA-Z_?\.$]+\w*)\s*=\s* + ([a-zA-Z_?.$][\w?.$]*)\.(prototype)\.([a-zA-Z_?.$][\w?.$]*)\s*=\s* name meta.function.js @@ -149,7 +149,7 @@ comment match stuff like: Sound.play = function() { … } match - ([a-zA-Z_?\.\$]+\w*)\.([a-zA-Z_?\.\$]+\w*)\s*=\s*(function)\s*(\()(.*?)(\)) + ([a-zA-Z_?.$][\w?.$]*)\.([a-zA-Z_?.$][\w?.$]*)\s*=\s*(function)\s*(\()(.*?)(\)) name meta.function.js @@ -185,7 +185,7 @@ comment match stuff like: play = function() { … } match - ([a-zA-Z_?\$]+\w*)\s*=\s*(function)\s*(\()(.*?)(\)) + ([a-zA-Z_?$][\w?$]*)\s*=\s*(function)\s*(\()(.*?)(\)) name meta.function.js @@ -257,7 +257,7 @@ comment match stuff like: foobar: function() { … } match - \b([a-zA-Z_?\.$]+\w*)\s*:\s*\b(function)?\s*(\()(.*?)(\)) + \b([a-zA-Z_?.$][\w?.$]*)\s*:\s*\b(function)?\s*(\()(.*?)(\)) name meta.function.json.js @@ -347,7 +347,7 @@ match - (new)\s+(\w+\.?\w*) + (new)\s+(\w+(?:\.\w*)?) name meta.class.instance.constructor