Commits

Amaury Forgeot d'Arc  committed 3b48363

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.

  • Participants
  • Parent commits f3a0dbf

Comments (0)

Files changed (1)

File pypy/interpreter/pyparser/parsestring.py

     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')