[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: > Can I ask how pegen solved this problem? Did you move parsing of f-strings > into the grammar? No, we actually do a very similar thing to what ast.c does. I think there is only one major difference between what pegen does and what ast.c does. If I und

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: Can I ask how pegen solved this problem? Did you move parsing of f-strings into the grammar? I found my patch and I'm working on resolving merge conflicts. -- ___ Python tracker

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: Also note that for pegen this is a solved problem. If we decide to change the parser, it may not be worth it to spend too much time on a universal solution. -- ___ Python tracker

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-06 Thread Eric V. Smith
Eric V. Smith added the comment: I'll see if I can dig up the patch today. If I can find it, I'll attach it to issue 34364. This is really the first time I've tried to write down all of the issues related to tokenizing f-strings. It does seem a little daunting, but I'm not done noodling it

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum
Guido van Rossum added the comment: Wow. Do you still have a branch with that non-working patch? Maybe there are some ideas that can be salvaged. I'm wondering if maybe we're better leaving f-strings alone? The current code is quite voluminous, but it looks as if by the time you've addressed

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, my approach is to use the tokenizer to produce the parts of the f-string, instead of treating it as a normal string and making a second pass to parse out the pieces. I've been discussing this for a few years, and at last PyCon I talked to many tool vendo

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum
Guido van Rossum added the comment: This is indeed a duplicate of issue35212 (the second message there also shows a problem with implicit f-string concatenation). There's not much information in issue34364 (just a merged PR, and a mention of a PR of yours from 2 years ago that apparently nev

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Guido van Rossum
Guido van Rossum added the comment: Note that this is somewhat urgent for oefen, since we strive to match the produced AST exactly. -- --Guido (mobile) -- ___ Python tracker

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Eric V. Smith
Eric V. Smith added the comment: There are a number of bugs about this. See issue 35212 and issue 34364, at least. I have a stale patch that tried to fix this, but I was never able to get it completely correct. I have another approach that I hope to discuss at the language summit at PyCon.

[issue39564] Parsed expression has wrong col_offset when concatenating f-strings

2020-02-05 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- title: Parsed expression has wrong line/col info when concatenating f-strings -> Parsed expression has wrong col_offset when concatenating f-strings ___ Python tracker _