mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
-- fixed width calculations for alternations
-- 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)
This commit is contained in:
parent
329e29198d
commit
2f2c67d7e5
4 changed files with 199 additions and 35 deletions
|
@ -270,6 +270,7 @@ def _compile_info(code, pattern, flags):
|
|||
table[i+1] = table[table[i+1]-1]+1
|
||||
code.extend(table[1:]) # don't store first entry
|
||||
elif charset:
|
||||
# FIXME: use charset optimizer!
|
||||
for char in charset:
|
||||
emit(OPCODES[LITERAL])
|
||||
emit(char)
|
||||
|
@ -283,7 +284,7 @@ try:
|
|||
except NameError:
|
||||
pass
|
||||
|
||||
def _compile1(p, flags):
|
||||
def _code(p, flags):
|
||||
|
||||
flags = p.pattern.flags | flags
|
||||
code = []
|
||||
|
@ -308,7 +309,7 @@ def compile(p, flags=0):
|
|||
else:
|
||||
pattern = None
|
||||
|
||||
code = _compile1(p, flags)
|
||||
code = _code(p, flags)
|
||||
|
||||
# print code
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue