Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: Changeset: r54046:3b48363cff78 Date: 2012-03-28 23:24 +0200 http://bitbucket.org/pypy/pypy/changeset/3b48363cff78/
Log: Remove dead code. Q: Where does it come from? A: from CPython: Python/ast.c Q: Why this code in CPython? A: In file Grammar/Grammar, keywords and operators are enclosed in quotes ('def', '+='); grammar.c contains logic to create the various tokens, and separate keywords from operators; probably in old ages the same code was used to parse the Python language as well. diff --git a/pypy/interpreter/pyparser/parsestring.py b/pypy/interpreter/pyparser/parsestring.py --- a/pypy/interpreter/pyparser/parsestring.py +++ b/pypy/interpreter/pyparser/parsestring.py @@ -23,21 +23,18 @@ rawmode = False # string decoration handling - o = ord(quote) - isalpha = (o>=97 and o<=122) or (o>=65 and o<=90) - if isalpha or quote == '_': - if quote == 'b' or quote == 'B': - ps += 1 - quote = s[ps] - unicode_literal = False - elif quote == 'u' or quote == 'U': - ps += 1 - quote = s[ps] - unicode_literal = True - if quote == 'r' or quote == 'R': - ps += 1 - quote = s[ps] - rawmode = True + if quote == 'b' or quote == 'B': + ps += 1 + quote = s[ps] + unicode_literal = False + elif quote == 'u' or quote == 'U': + ps += 1 + quote = s[ps] + unicode_literal = True + if quote == 'r' or quote == 'R': + ps += 1 + quote = s[ps] + rawmode = True if quote != "'" and quote != '"': raise_app_valueerror(space, 'Internal error: parser passed unquoted literal') _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit