[pypy-svn] r75386 - pypy/branch/multijit-4/pypy/rlib/rsre
arigo at codespeak.net
arigo at codespeak.net
Mon Jun 14 10:37:37 CEST 2010
Author: arigo
Date: Mon Jun 14 10:37:35 2010
New Revision: 75386
Modified:
pypy/branch/multijit-4/pypy/rlib/rsre/rsre_char.py
pypy/branch/multijit-4/pypy/rlib/rsre/rsre_core.py
Log:
No-op.
Modified: pypy/branch/multijit-4/pypy/rlib/rsre/rsre_char.py
==============================================================================
--- pypy/branch/multijit-4/pypy/rlib/rsre/rsre_char.py (original)
+++ pypy/branch/multijit-4/pypy/rlib/rsre/rsre_char.py Mon Jun 14 10:37:35 2010
@@ -41,6 +41,7 @@
SRE_INFO_LITERAL = 2
SRE_FLAG_LOCALE = 4 # honour system locale
SRE_FLAG_UNICODE = 32 # use unicode locale
+OPCODE_SUCCESS = 1
OPCODE_INFO = 17
OPCODE_LITERAL = 19
MAXREPEAT = 65535
Modified: pypy/branch/multijit-4/pypy/rlib/rsre/rsre_core.py
==============================================================================
--- pypy/branch/multijit-4/pypy/rlib/rsre/rsre_core.py (original)
+++ pypy/branch/multijit-4/pypy/rlib/rsre/rsre_core.py Mon Jun 14 10:37:35 2010
@@ -12,6 +12,7 @@
from pypy.rlib.rsre import rsre_char
from pypy.rlib.rsre.rsre_char import SRE_INFO_PREFIX, SRE_INFO_LITERAL
from pypy.rlib.rsre.rsre_char import OPCODE_INFO, MAXREPEAT
+from pypy.rlib.rsre.rsre_char import OPCODE_SUCCESS, OPCODE_LITERAL
from pypy.rlib.unroll import unrolling_iterable
#### Core classes
@@ -456,7 +457,7 @@
if count < mincount:
ctx.has_matched = ctx.NOT_MATCHED
return True
- if ctx.peek_code(ctx.peek_code(1) + 1) == 1: # 1 == OPCODES["success"]
+ if ctx.peek_code(ctx.peek_code(1) + 1) == OPCODE_SUCCESS:
# tail is empty. we're finished
ctx.state.string_position = ctx.string_position
ctx.has_matched = ctx.MATCHED
@@ -480,7 +481,7 @@
# <optimization_only>
ok = True
nextidx = ctx.peek_code(1)
- if ctx.peek_code(nextidx + 1) == 19: # 19 == OPCODES["literal"]
+ if ctx.peek_code(nextidx + 1) == OPCODE_LITERAL:
# tail starts with a literal. skip positions where
# the rest of the pattern cannot possibly match
chr = ctx.peek_code(nextidx + 2)
@@ -528,7 +529,7 @@
ctx.has_matched = ctx.NOT_MATCHED
return True
ctx.skip_char(count)
- if ctx.peek_code(ctx.peek_code(1) + 1) == 1: # OPCODES["success"]
+ if ctx.peek_code(ctx.peek_code(1) + 1) == OPCODE_SUCCESS:
# tail is empty. we're finished
ctx.state.string_position = ctx.string_position
ctx.has_matched = ctx.MATCHED
More information about the Pypy-commit
mailing list