mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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:
parent
c474deaaf6
commit
5026cb4dc6
1 changed files with 7 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue