diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2020-05-04 11:32:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 11:32:18 (GMT) |
commit | 846d8b28ab9bb6197ee81372820311c0abe509c0 (patch) | |
tree | bbcdb73b768194661bef017b18aed9e870d98c24 /Parser | |
parent | e10e7c771bf06112c4a311e0ef6b8af6423b0cca (diff) | |
download | cpython-846d8b28ab9bb6197ee81372820311c0abe509c0.zip cpython-846d8b28ab9bb6197ee81372820311c0abe509c0.tar.gz cpython-846d8b28ab9bb6197ee81372820311c0abe509c0.tar.bz2 |
bpo-40246: Revert reporting of invalid string prefixes (GH-19888)
Due to backwards compatibility concerns regarding keywords immediately followed by a string without whitespace between them (like in `bg="#d00" if clear else"#fca"`) will fail to parse,
commit 41d5b94af44e34ac05d4cd57460ed104ccf96628 has to be reverted.
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/pegen/pegen.c | 3 | ||||
-rw-r--r-- | Parser/tokenizer.c | 4 |
2 files changed, 0 insertions, 7 deletions
diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 391f9b9..c311593 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -334,9 +334,6 @@ tokenizer_error(Parser *p) case E_IDENTIFIER: msg = "invalid character in identifier"; break; - case E_BADPREFIX: - RAISE_SYNTAX_ERROR("invalid string prefix"); - return -1; case E_EOFS: RAISE_SYNTAX_ERROR("EOF while scanning triple-quoted string literal"); return -1; diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 95dfc53..0f2b6af 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1396,10 +1396,6 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end) *p_start = tok->start; *p_end = tok->cur; - if (c == '"' || c == '\'') { - tok->done = E_BADPREFIX; - return ERRORTOKEN; - } /* async/await parsing block. */ if (tok->cur - tok->start == 5 && tok->start[0] == 'a') { /* May be an 'async' or 'await' token. For Python 3.7 or |