mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Bytes literal.
This commit is contained in:
parent
cf297e46b8
commit
00e41defe8
15 changed files with 179 additions and 19 deletions
|
|
@ -60,6 +60,7 @@ module Python version "$Revision$"
|
|||
expr? starargs, expr? kwargs)
|
||||
| Num(object n) -- a number as a PyObject.
|
||||
| Str(string s) -- need to specify raw, unicode, etc?
|
||||
| Bytes(string s)
|
||||
| Ellipsis
|
||||
-- other literals? bools?
|
||||
|
||||
|
|
|
|||
|
|
@ -1244,6 +1244,14 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
|
|||
if (c == '"' || c == '\'')
|
||||
goto letter_quote;
|
||||
break;
|
||||
case 'b':
|
||||
case 'B':
|
||||
c = tok_nextc(tok);
|
||||
if (c == 'r' || c == 'R')
|
||||
c = tok_nextc(tok);
|
||||
if (c == '"' || c == '\'')
|
||||
goto letter_quote;
|
||||
break;
|
||||
}
|
||||
while (isalnum(c) || c == '_') {
|
||||
c = tok_nextc(tok);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue