]> granicus.if.org Git - python/commitdiff
Now that the string-sig has settled on r"obin" strings, restrict the
authorGuido van Rossum <guido@python.org>
Fri, 25 Apr 1997 17:32:00 +0000 (17:32 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 25 Apr 1997 17:32:00 +0000 (17:32 +0000)
<letter><string> notation to 'r' and 'R'.

Parser/tokenizer.c

index 3bf0fee0c70f20fa66b215cbdfeac6d1286e9ad3..9f268402d550b67faec01149451ddcf79f93af3b 100644 (file)
@@ -541,9 +541,13 @@ tok_get(tok, p_start, p_end)
        
        /* Identifier (most frequent token!) */
        if (isalpha(c) || c == '_') {
-               c = tok_nextc(tok);
-               if (c == '"' || c == '\'')
-                       goto letter_quote;
+               switch (c) {
+               case 'r':
+               case 'R':
+                       c = tok_nextc(tok);
+                       if (c == '"' || c == '\'')
+                               goto letter_quote;
+               }
                while (isalnum(c) || c == '_') {
                        c = tok_nextc(tok);
                }