Not *quite* right, since this would ignore any lines that have even a single '/' character prior to the function keyword ([...] defines a character class, so having two "/" in the set will still just match any "/" character).
So, if you had a line like this:
var foo = { delimiter: "/", parser: function(str) { // parse code goes here } };
but even if you fixed the pattern, it's still valid to say:
var foo = { delimiter: "//", parser: function(str) { // parse code goes here } };
Granted this is an edge case, but as a developer, I love thinking up edge cases. Can't help myself.
-Brad
On Mar 6, 2007, at 1:48 PM, John Cromartie wrote:
By the way, to fix the "OMFG CRAPPY FOLDING IN MY JS CODE!!!!!" ...
change the Javascript language definition to ignore lines that start with "//" by replacing the first ".*" with "[^//]*"
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate