From: SourceForge.net <no...@so...> - 2008-01-02 22:15:59
|
Patches item #1860727, was opened at 2007-12-29 17:12 Message generated for change (Comment added) made by hobbs You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1860727&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 42. Regexp Group: TIP Implementation Status: Open Resolution: None Priority: 6 Private: No Submitted By: Jeffrey Hobbs (hobbs) Assigned to: Jeffrey Hobbs (hobbs) Summary: PCRE optional regexp Initial Comment: Attached is a diff that adds a configure --with-pcre option, as well as -type classic|pcre -binary options to [regexp] (available in either build, only functional with --with-pcre). --with-pcre=/path/to/pcre (or have it installed in a "default" location). Initial testing shows that PCRE is significantly faster in all cases the the classic Spencer engine. ---------------------------------------------------------------------- >Comment By: Jeffrey Hobbs (hobbs) Date: 2008-01-02 14:16 Message: Logged In: YES user_id=72656 Originator: YES Updated version that doesn't leak the study'd pcre info, corrects more tests and is generally better, so just use it. File Added: pcre.diff4.gz ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2007-12-31 12:16 Message: Logged In: YES user_id=72656 Originator: YES New patch that calms some tests, fixes [lsearch -regexp] crash condition. Note that any calls that use Tcl_GetRegexpFromObj with NULL interp can't check the [interp regexp {} pcre] state (as lsearch -regexp does). In this version, you can set environment TCL_REGEXP_PCRE to have PCRE enabled by default in Tcl interps. File Added: pcre.diff3.gz ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2007-12-30 18:15 Message: Logged In: YES user_id=72656 Originator: YES Updated version that has cleaner integration. The conversion of RE compile flags is done at the caching of the object. This version includes fully correct handling in [regsub] (you'll find the it is mostly transparent to Tcl_RegsubObjCmd), with support for the whole Tcl_GetRegExpFromObj/Tcl_RegExpExecObj/Tcl_RegExpGetInfo path of execution being handled 100% transparently for classic or PCRE REs. The translation of flags needs to be better reconciled between Spencer's flag meanings and PCREs (like TCL_REG_NLSTOP TCL_REG_NLMATCH == ??? in PCRE). File Added: pcre.diff2.gz ---------------------------------------------------------------------- Comment By: Jeffrey Hobbs (hobbs) Date: 2007-12-29 18:04 Message: Logged In: YES user_id=72656 Originator: YES Updated version that adds: interp regexp {} ?classic|pcre? So set the default engine with [interp regexp {} pcre]. I've also added support in Tcl_RegExpExecObj to recognize compiled PCREs so that the compile case works. It currently assumes -binary operation by default. In the lmbench grep.tcl code, you need to add: if {![catch {interp regexp {}}]} { puts stderr "PCRE regexp" interp regexp {} pcre } else { puts stderr "TCL regexp" } and then it will work as before, just faster. File Added: pcre.diff.gz ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=1860727&group_id=10894 |