Closed lysnikolaou closed 4 years ago
@pablogsal @gvanrossum Is there a way to fix this in a way that doesn't require too much effort? I can't think of something.
Line numbers were fixed by pre-feeding starting line and column numbers to the parser in https://github.com/we-like-parsers/cpython/pull/96/commits/991a634f420e2368fc64840b052430fde04a9ca3. There is still a bug with the column offsets, because the node shifting of the nested expression is executed before that of the outer one.
There is still a bug with the column offsets, because the node shifting of the nested expression is executed before that of the outer one.
Would a single node-shift of the whole f-string tree work? Or we do require two (ordered) shifts?
There is still a bug with the column offsets, because the node shifting of the nested expression is executed before that of the outer one.
Would a single node-shift of the whole f-string tree work? Or we do require two (ordered) shifts?
That might work, yeah! I'll work on it in a bit.
Parsing the following:
produces the following AST (not complete):