Now that the string-sig has settled on r"obin" strings, restrict the

<letter><string> notation to 'r' and 'R'.
This commit is contained in:
Guido van Rossum 1997-04-25 17:32:00 +00:00
parent c474deaaf6
commit 5026cb4dc6
1 changed files with 7 additions and 3 deletions

View 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);
}