mirror of
https://github.com/davidhalter/parso.git
synced 2026-05-24 17:28:53 +08:00
Fix py3.3 and remove a print.
This commit is contained in:
@@ -21,7 +21,7 @@ class TokenNamespace:
|
|||||||
EXCLAMATION_MARK = next(_c)
|
EXCLAMATION_MARK = next(_c)
|
||||||
UNTERMINATED_STRING = next(_c)
|
UNTERMINATED_STRING = next(_c)
|
||||||
|
|
||||||
token_map = dict((v, k) for k, v in locals().items())
|
token_map = dict((v, k) for k, v in locals().items() if not k.startswith('_'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generate_token_id(cls, string):
|
def generate_token_id(cls, string):
|
||||||
@@ -55,11 +55,7 @@ _compiled_in_expr = re.compile(_in_expr)
|
|||||||
_compiled_conversion = re.compile(_conversion)
|
_compiled_conversion = re.compile(_conversion)
|
||||||
|
|
||||||
|
|
||||||
def tokenize(*args, **kwargs):
|
def tokenize(code, start_pos=(1, 0)):
|
||||||
for t in _tokenize(*args, **kwargs):
|
|
||||||
print(t)
|
|
||||||
yield t
|
|
||||||
def _tokenize(code, start_pos=(1, 0)):
|
|
||||||
def add_to_pos(string):
|
def add_to_pos(string):
|
||||||
lines = split_lines(string)
|
lines = split_lines(string)
|
||||||
l = len(lines[-1])
|
l = len(lines[-1])
|
||||||
|
|||||||
Reference in New Issue
Block a user