summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
Commit message (Collapse)AuthorAgeFilesLines
* Patch# 1258 by Christian Heimes: kill basestring.Guido van Rossum2007-10-161-1/+1
| | | | I like this because it makes the code shorter! :-)
* Raise statement normalization in Lib/.Collin Winter2007-08-301-5/+5
|
* Merged revisions 56154-56264 via svnmerge fromGuido van Rossum2007-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ................ r56155 | neal.norwitz | 2007-07-03 08:59:08 +0300 (Tue, 03 Jul 2007) | 1 line Get this test working after converting map to return an iterator ................ r56202 | neal.norwitz | 2007-07-09 04:30:09 +0300 (Mon, 09 Jul 2007) | 37 lines Merged revisions 56124-56201 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r56129 | georg.brandl | 2007-06-30 04:01:01 -0700 (Sat, 30 Jun 2007) | 2 lines Document smtp.SMTPAuthenticationError. ........ r56137 | georg.brandl | 2007-07-01 01:11:35 -0700 (Sun, 01 Jul 2007) | 2 lines Fix a few webbrowser.py problems. ........ r56143 | georg.brandl | 2007-07-02 04:54:28 -0700 (Mon, 02 Jul 2007) | 2 lines Remove duplicate sentence from alarm() doc. ........ r56170 | mark.hammond | 2007-07-03 19:03:10 -0700 (Tue, 03 Jul 2007) | 3 lines copy built files to the PCBuild directory, where tools like distutils or external build processes can find them. ........ r56176 | kurt.kaiser | 2007-07-05 15:03:39 -0700 (Thu, 05 Jul 2007) | 10 lines Many calls to tk.call involve an arglist containing a single tuple. Calls using METH_OLDARGS unpack this tuple; calls using METH_VARARG don't. Tcl's concatenation of args was affected; IDLE doesn't start. Modify Tkapp_Call() to unpack single tuple arglists. Bug 1733943 Ref http://mail.python.org/pipermail/python-checkins/2007-May/060454.html ........ r56177 | neal.norwitz | 2007-07-05 21:13:39 -0700 (Thu, 05 Jul 2007) | 1 line Fix typo in comment ........ ................ r56251 | neal.norwitz | 2007-07-11 10:01:01 +0300 (Wed, 11 Jul 2007) | 1 line Get working with map returning an iterator (had to fix whitespace too) ................ r56255 | thomas.wouters | 2007-07-11 13:41:37 +0300 (Wed, 11 Jul 2007) | 6 lines Clean up merge glitch or copy-paste error (the entire module was duplicated, except the first half even had some more copy-paste errors, referring to listcomps and genexps instead of setcomps) ................ r56256 | thomas.wouters | 2007-07-11 15:16:01 +0300 (Wed, 11 Jul 2007) | 14 lines Dict comprehensions. Still needs doc changes (like many python-3000 features ;-). It generates bytecode similar to: x = {} for k, v in (generator here): x[k] = v except there is no tuple-packing and -unpacking involved. Trivial measurement suggests it's significantly faster than dict(generator here) (in the order of 2 to 3 times as fast) but I have not done extensive measurements. ................ r56263 | guido.van.rossum | 2007-07-11 15:36:26 +0300 (Wed, 11 Jul 2007) | 3 lines Patch 1724999 by Ali Gholami Rudi -- avoid complaints about dict size change during iter in destroy call. ................
* Creating an array with a bytes object as initializerGuido van Rossum2007-07-031-0/+1
| | | | | should treat the bytes as it treats a string. Not doing this broke re.compile() of big charsets.
* Merged revisions 55007-55179 via svnmerge fromGuido van Rossum2007-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55077 | guido.van.rossum | 2007-05-02 11:54:37 -0700 (Wed, 02 May 2007) | 2 lines Use the new print syntax, at least. ........ r55142 | fred.drake | 2007-05-04 21:27:30 -0700 (Fri, 04 May 2007) | 1 line remove old cruftiness ........ r55143 | fred.drake | 2007-05-04 21:52:16 -0700 (Fri, 04 May 2007) | 1 line make this work with the new Python ........ r55162 | neal.norwitz | 2007-05-06 22:29:18 -0700 (Sun, 06 May 2007) | 1 line Get asdl code gen working with Python 2.3. Should continue to work with 3.0 ........ r55164 | neal.norwitz | 2007-05-07 00:00:38 -0700 (Mon, 07 May 2007) | 1 line Verify checkins to p3yk (sic) branch go to 3000 list. ........ r55166 | neal.norwitz | 2007-05-07 00:12:35 -0700 (Mon, 07 May 2007) | 1 line Fix this test so it runs again by importing warnings_test properly. ........ r55167 | neal.norwitz | 2007-05-07 01:03:22 -0700 (Mon, 07 May 2007) | 8 lines So long xrange. range() now supports values that are outside -sys.maxint to sys.maxint. floats raise a TypeError. This has been sitting for a long time. It probably has some problems and needs cleanup. Objects/rangeobject.c now uses 4-space indents since it is almost completely new. ........ r55171 | guido.van.rossum | 2007-05-07 10:21:26 -0700 (Mon, 07 May 2007) | 4 lines Fix two tests that were previously depending on significant spaces at the end of a line (and before that on Python 2.x print behavior that has no exact equivalent in 3.0). ........
* Checkpoint. Manipulated things so that string literals are alwaysGuido van Rossum2007-04-271-11/+1
| | | | | | | | unicode, and a few other compensating changes, e.g. str <- unicode, chr <- unichr, and repr() of a unicode string no longer starts with 'u'. Lots of unit tests are broken, but some basic things work, in particular distutils works so the extensions can be built, and test_builtin.py works.
* Rip out 'long' and 'L'-suffixed integer literals.Guido van Rossum2007-01-151-2/+2
| | | | (Rough first cut.)
* [Bug #1177831] Fix generation of code for GROUPREF_EXISTS. Thanks to Andre ↵Andrew M. Kuchling2005-06-021-1/+1
| | | | Malo for the fix.
* Complete the previous effort to factor out constant expressionsRaymond Hettinger2005-02-281-4/+15
| | | | and improve the speed of the if/elif/else blocks.
* make sure to check for this limit even if we're running with -OFredrik Lundh2004-10-151-2/+4
|
* Fix _sre.CODESIZE on 64-bit machines in UCS-4 mode. Fixes #931848.Martin v. Löwis2004-05-071-3/+5
| | | | Backported to 2.3.
* Revert 1.51 booleans so that sre will still run on old pythons.Raymond Hettinger2004-03-271-6/+6
|
* Remove unnecessary test. (Thanks Skip)Raymond Hettinger2004-03-261-6/+0
|
* Simple optimizations:Raymond Hettinger2004-03-261-47/+69
| | | | | | | | | * pre-build a single identity function for the fixup function * pre-build membership tests in dictionaries instead of in-line tuples * assign len() to a local variable * assign append() methods to a local variable * use xrange() instead of range() * replace "x<<1" with "x+x"
* Use True/False instead of 0/1 for character classes.Martin v. Löwis2004-03-251-6/+6
|
* Implemented non-recursive SRE matching.Gustavo Niemeyer2003-10-171-0/+13
|
* Addendum to #764548: restore 2.1 compatibility.Just van Rossum2003-07-021-2/+8
|
* Fix and test for bug #764548:Just van Rossum2003-07-021-5/+5
| | | | | | Use isinstance() instead of comparing types directly, to enable subclasses of str and unicode to be used as patterns. Blessed by /F.
* Fully support 32-bit codes. Enable BIGCHARSET in UCS-4 builds.Martin v. Löwis2003-04-191-23/+46
|
* SF patch #720991 by Gary Herron:Guido van Rossum2003-04-141-2/+5
| | | | | | | A small fix for bug #545855 and Greg Chapman's addition of op code SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of pattern '*?' on a long string.
* Fix from SF patch #633359 by Greg Chapman for SF bug #610299:Guido van Rossum2003-02-241-1/+1
| | | | | | | | | The problem is in sre_compile.py: the call to _compile_charset near the end of _compile_info forgets to pass in the flags, so that the info charset is not compiled with re.U. (The info charset is used when searching to find the first character at which a match could start; it is not generated for patterns beginning with a repeat like '\w{1}'.)
* Disable big charsets in UCS-4 builds. Works around #599377.Martin v. Löwis2002-09-261-0/+3
| | | | Will backport to 2.2
* made the code match the comments (1.5.2 compatibility)Fredrik Lundh2002-06-271-3/+3
|
* Replace boolean test with is None.Raymond Hettinger2002-06-021-1/+1
|
* Added docstrings by Neal Norwitz. This closes SF bug #450980.Fred Drake2001-09-041-0/+2
|
* Whitespace normalization, plus:Tim Peters2001-07-211-1/+1
| | | | | | + test_quopri.py relied on significant trailing spaces. Fixed. + test_dircache.py (still) doesn't work on Windows (directory mtime on Windows doesn't work like it does on Unix).
* Patch #442512: put block indices in the right byte order on bigendian systems.Martin v. Löwis2001-07-191-2/+5
|
* added martin's BIGCHARSET patch to SRE 2.1.1. martin reports 2xFredrik Lundh2001-07-021-10/+71
| | | | speedups for certain unicode character ranges.
* sre 2.1b2 update:Fredrik Lundh2001-03-221-7/+9
| | | | | | - take locale into account for word boundary anchors (#410271) - restored 2.0's *? behaviour (#233283, #408936 and others) - speed up re.sub/re.subn
* - restored 1.5.2 compatibility (sorry, eric)Fredrik Lundh2001-02-181-2/+0
| | | | | - removed __all__ cruft from internal modules (sorry, skip) - don't assume ASCII for string escapes (sorry, per)
* bunch more __all__ listsSkip Montanaro2001-02-151-0/+2
| | | | | | also modified check_all function to suppress all warnings since they aren't relevant to what this test is doing (allows quiet checking of regsub, for instance)
* from the really-stupid-bug department: uppercase literals should matchFredrik Lundh2001-01-151-1/+2
| | | | | | | uppercase strings also when the IGNORECASE flag is set (bug #128899) (also added test cases for recently fixed bugs to the regression suite -- or in other words, check in re_tests.py too...)
* added "magic" number to the _sre module, to avoid weird errors causedFredrik Lundh2001-01-151-0/+2
| | | | by compiler/engine mismatches
* SRE fixes for 2.1 alpha:Fredrik Lundh2001-01-141-3/+3
| | | | | | | | | | -- added some more docstrings -- fixed typo in scanner class (#125531) -- the multiline flag (?m) should't affect the \Z operator (#127259) -- fixed non-greedy backtracking bug (#123769, #127259) -- added sre.DEBUG flag (currently dumps the parsed pattern structure) -- fixed a couple of glitches in groupdict (the #126587 memory leak had already been fixed by AMK)
* Fixed too ambitious "nothing to repeat" check. Closes bug #114033.Fredrik Lundh2000-10-071-1/+1
|
* -- reset marks if repeat_one tail doesn't matchFredrik Lundh2000-08-071-103/+153
| | | | | | | (this should fix Sjoerd's xmllib problem) -- added skip field to INFO header -- changed compiler to generate charset INFO header -- changed trace messages to support post-mortem analysis
* final 0.9.8 updates:Fredrik Lundh2000-08-011-25/+26
| | | | | -- added REPEAT_ONE operator -- added ANY_ALL operator (used to represent "(?s).")
* -- fixed width calculations for alternationsFredrik Lundh2000-08-011-2/+3
| | | | | | | -- fixed literal check in branch operator (this broke test_tokenize, as reported by Mark Favas) -- added REPEAT_ONE operator (still not enabled, though) -- added some debugging stuff (maxlevel)
* SRE 0.9.8: passes the entire test suiteFredrik Lundh2000-08-011-35/+29
| | | | | | | | | -- reverted REPEAT operator to use "repeat context" strategy (from 0.8.X), but done right this time. -- got rid of backtracking stack; use nested SRE_MATCH calls instead (should probably put it back again in 0.9.9 ;-) -- properly reset state in scanner mode -- don't use aggressive inlining by default
* -- SRE 0.9.6 sync. this includes:Fredrik Lundh2000-07-231-2/+12
| | | | | | | | | | | + added "regs" attribute + fixed "pos" and "endpos" attributes + reset "lastindex" and "lastgroup" in scanner methods + removed (?P#id) syntax; the "lastindex" and "lastgroup" attributes are now always set + removed string module dependencies in sre_parse + better debugging support in sre_parse + various tweaks to build under 1.5.2
* maintenance release:Fredrik Lundh2000-07-051-1/+3
| | | | | | | | - reorganized some code to get rid of -Wall and -W4 warnings - fixed default argument handling for sub/subn/split methods (reported by Peter Schneider-Kamp).
* - fixed grouping error bugFredrik Lundh2000-07-031-6/+13
| | | | - changed "group" operator to "groupref"
* - added lookbehind support (?<=pattern), (?<!pattern).Fredrik Lundh2000-07-031-12/+17
| | | | | | | | | | | | | | | | | the pattern must have a fixed width. - got rid of array-module dependencies; the match pro- gram is now stored inside the pattern object, rather than in an extra string buffer. - cleaned up a various of potential leaks, api abuses, and other minors in the engine module. - use mal's new isalnum macro, rather than my own work- around. - untabified test_sre.py. seems like I removed a couple of trailing spaces in the process...
* - experimental: added two new attributes to the match object:Fredrik Lundh2000-07-021-1/+7
| | | | | | | | "lastgroup" is the name of the last matched capturing group, "lastindex" is the index of the same group. if no group was matched, both attributes are set to None. the (?P#) feature will be removed in the next relase.
* - actually enabled charset anchors in the engine (still notFredrik Lundh2000-07-021-1/+1
| | | | | | | | | | used by the code generator) - changed max repeat value in engine (to match earlier array fix) - added experimental "which part matched?" mechanism to sre; see http://hem.passagen.se/eff/2000_07_01_bot-archive.htm#416954 or python-dev for details.
* -- use charset bitmaps where appropriate. this gives a 5-10%Fredrik Lundh2000-07-021-17/+93
| | | | | | | | | speedup for some tests, including the python tokenizer. -- added support for an optional charset anchor to the engine (currently unused by the code generator). -- removed workaround for array module bug.
* today's SRE update:Fredrik Lundh2000-07-011-1/+1
| | | | | | | | -- changed 1.6 to 2.0 in the file headers -- fixed ISALNUM macro for the unicode locale. this solution isn't perfect, but the best I can do with Python's current unicode database.
* - fixed code generation error in multiline modeFredrik Lundh2000-06-301-2/+2
| | | | - fixed parser flag propagation (of all stupid bugs...)
* - reverted to "\x is binary byte"Fredrik Lundh2000-06-301-1/+1
| | | | - removed evil tabs from sre_parse and sre_compile
* the mad patcher strikes again:Fredrik Lundh2000-06-301-4/+4
| | | | | | | | | | | | | | | -- added pickling support (only works if sre is imported) -- fixed wordsize problems in engine (instead of casting literals down to the character size, cast characters up to the literal size (same as the code word size). this prevents false hits when you're matching a unicode pattern against an 8-bit string. (unfortunately, this broke another test, but I think the test should be changed in this case; more on that on python-dev) -- added sre.purge function (unofficial, clears the cache)