summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-07-29 13:59:13 (GMT)
committerPablo Galindo <Pablogsal@gmail.com>2019-07-29 13:59:13 (GMT)
commit5b94f3578c662d5f1ee90c0e6b81481d9ec82d89 (patch)
tree3f57146c75113283e71a598108cfb4d7295443bb /Parser
parente1b900247227dad49d8231f1d028872412230ab4 (diff)
downloadcpython-5b94f3578c662d5f1ee90c0e6b81481d9ec82d89.zip
cpython-5b94f3578c662d5f1ee90c0e6b81481d9ec82d89.tar.gz
cpython-5b94f3578c662d5f1ee90c0e6b81481d9ec82d89.tar.bz2
Fix `SyntaxError` indicator printing too many spaces for multi-line strings (GH-14433)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index c2ec659..31fe970 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -956,6 +956,7 @@ tok_nextc(struct tok_state *tok)
while (!done) {
Py_ssize_t curstart = tok->start == NULL ? -1 :
tok->start - tok->buf;
+ Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf;
Py_ssize_t curvalid = tok->inp - tok->buf;
Py_ssize_t newsize = curvalid + BUFSIZ;
char *newbuf = tok->buf;
@@ -968,6 +969,7 @@ tok_nextc(struct tok_state *tok)
}
tok->buf = newbuf;
tok->cur = tok->buf + cur;
+ tok->multi_line_start = tok->buf + cur_multi_line_start;
tok->line_start = tok->cur;
tok->inp = tok->buf + curvalid;
tok->end = tok->buf + newsize;