[jQuery] filter refactored with the engine of Chili

[jQuery] filter refactored with the engine of Chili

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:lucida console, sans-serif;font-size:10pt"><DIV>Hi there.</DIV>
<DIV> </DIV>
<DIV>I've refactored the "filter" core function of jQuery, merging my Chili parser into it. Now it should be cleaner, faster and tighter (I hope so)</DIV>
<DIV> </DIV>
<DIV>I passed it through coreTest.js, and all is fine for these browsers:</DIV>
<UL dir=ltr style="MARGIN-RIGHT: 0px">
<LI>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)</LI>
<LI>Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8</LI></UL>
<DIV>Based on $Rev: 501, which measured 19016/53077 bytes, the new jQuery measures 20471/57966 bytes</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Do you think it could be used in production?</DIV>
<DIV> </DIV>
<P>Andrea</P>
<P> </P>
<P> </P>
<DIV><BR>Main changes:</DIV>
<DIV>----------------------------------------</DIV>
<DIV> </DIV>
<DIV> * a changed parsing engine where only 1 regexp match is executed on any call (there were some more)</DIV>
<DIV><BR> * a new preprocessing phase which builds one regexp out of the configuration object (calculated only on the first call, and cached for later use)</DIV>
<DIV><BR> * a changed configuration object (there were 2), which holds the regular expressions together with their relative checks on the elements</DIV>
<DIV><BR> * a tighter grammar, easier to maintain and augment</DIV>
<DIV><BR> * comments, meaningful names, patterns</DIV>
<DIV>----------------------------------------</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></div>
<hr size=1>Cheap Talk? <a href="http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">Check out</a> Yahoo! Messenger's low PC-to-Phone call rates.</body></html>_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/