mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +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!) */
|
/* Identifier (most frequent token!) */
|
||||||
if (isalpha(c) || c == '_') {
|
if (isalpha(c) || c == '_') {
|
||||||
c = tok_nextc(tok);
|
switch (c) {
|
||||||
if (c == '"' || c == '\'')
|
case 'r':
|
||||||
goto letter_quote;
|
case 'R':
|
||||||
|
c = tok_nextc(tok);
|
||||||
|
if (c == '"' || c == '\'')
|
||||||
|
goto letter_quote;
|
||||||
|
}
|
||||||
while (isalnum(c) || c == '_') {
|
while (isalnum(c) || c == '_') {
|
||||||
c = tok_nextc(tok);
|
c = tok_nextc(tok);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue