summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-25 17:32:00 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-25 17:32:00 (GMT)
commit5026cb4dc6477c81c465c8d0f3a1e6c5344d20c5 (patch)
tree5c701da80226717c303fe1694712685635f5e746
parentc474deaaf63deb633bf9bc951c8cc1cd5d107eda (diff)
downloadcpython-5026cb4dc6477c81c465c8d0f3a1e6c5344d20c5.zip
cpython-5026cb4dc6477c81c465c8d0f3a1e6c5344d20c5.tar.gz
cpython-5026cb4dc6477c81c465c8d0f3a1e6c5344d20c5.tar.bz2
Now that the string-sig has settled on r"obin" strings, restrict the
<letter><string> notation to 'r' and 'R'.
-rw-r--r--Parser/tokenizer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 3bf0fee..9f26840 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -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);
}