diff options
author | Eric V. Smith <eric@trueblade.com> | 2015-09-19 18:51:32 (GMT) |
---|---|---|
committer | Eric V. Smith <eric@trueblade.com> | 2015-09-19 18:51:32 (GMT) |
commit | 235a6f09847ad554d8bf073d4e1d58d1e398ae8c (patch) | |
tree | 36ff217247cfcd108914065cea8ddf3ad056d192 /Parser/tokenizer.c | |
parent | aed8830af3bb5a79878cf0f603ebbd8a37f5b36e (diff) | |
download | cpython-235a6f09847ad554d8bf073d4e1d58d1e398ae8c.zip cpython-235a6f09847ad554d8bf073d4e1d58d1e398ae8c.tar.gz cpython-235a6f09847ad554d8bf073d4e1d58d1e398ae8c.tar.bz2 |
Issue #24965: Implement PEP 498 "Literal String Interpolation". Documentation is still needed, I'll open an issue for that.
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 5046fa5..2369be4 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1477,17 +1477,19 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end) nonascii = 0; if (is_potential_identifier_start(c)) { /* Process b"", r"", u"", br"" and rb"" */ - int saw_b = 0, saw_r = 0, saw_u = 0; + int saw_b = 0, saw_r = 0, saw_u = 0, saw_f = 0; while (1) { - if (!(saw_b || saw_u) && (c == 'b' || c == 'B')) + if (!(saw_b || saw_u || saw_f) && (c == 'b' || c == 'B')) saw_b = 1; /* Since this is a backwards compatibility support literal we don't want to support it in arbitrary order like byte literals. */ - else if (!(saw_b || saw_u || saw_r) && (c == 'u' || c == 'U')) + else if (!(saw_b || saw_u || saw_r || saw_f) && (c == 'u' || c == 'U')) saw_u = 1; /* ur"" and ru"" are not supported */ else if (!(saw_r || saw_u) && (c == 'r' || c == 'R')) saw_r = 1; + else if (!(saw_f || saw_b || saw_u) && (c == 'f' || c == 'F')) + saw_f = 1; else break; c = tok_nextc(tok); |