mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Get rid of many apply() calls.
This commit is contained in:
parent
f389c77273
commit
68468eba63
38 changed files with 85 additions and 91 deletions
|
@ -42,8 +42,8 @@ tok_name[NL] = 'NL'
|
|||
N_TOKENS += 2
|
||||
|
||||
def group(*choices): return '(' + '|'.join(choices) + ')'
|
||||
def any(*choices): return apply(group, choices) + '*'
|
||||
def maybe(*choices): return apply(group, choices) + '?'
|
||||
def any(*choices): return group(*choices) + '*'
|
||||
def maybe(*choices): return group(*choices) + '?'
|
||||
|
||||
Whitespace = r'[ \f\t]*'
|
||||
Comment = r'#[^\r\n]*'
|
||||
|
@ -157,7 +157,7 @@ def tokenize(readline, tokeneater=printtoken):
|
|||
# backwards compatible interface
|
||||
def tokenize_loop(readline, tokeneater):
|
||||
for token_info in generate_tokens(readline):
|
||||
apply(tokeneater, token_info)
|
||||
tokeneater(*token_info)
|
||||
|
||||
def generate_tokens(readline):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue