[TxMt] Re: PHP Grammar / Syntax Highlight Bug

joseph davison jwdavison at me.com
Fri Feb 12 01:28:10 UTC 2010


On Feb 10, 2010, at 11:07 AM, Tobias Jung wrote:


> "([^"\\]+|\\.)*"


Nice poison regex.  Took me awhile to recognize why the '\\'... 

Yes,  I suppose alternating between a greedy class match and a non-existent string on every character in a long file could take a while to finish...

And I suspect it wouldn't be hard to accidentally produce a regex that had similar behavior -- in fact, Murphy almost insists.

> Thus, it _is_ possible that changing the regex might result in slower
> syntax coloring.
> 
> I'd like to stress again that I don't believe that changing the grammar
> will be bad.
> But it is a matter that is not to be taken lightly.

Would be nice to have the ability to interrupt TM during a runaway regex expression (or other effort), but I suppose that would merely slow down every regex search.

joe



More information about the textmate mailing list