Fixes the lineno
- and col_offset
-related failures on in lib-python/3/test/test_fstring.py
.
See https://bugs.python.org/issue30465 and https://github.com/python/cpython/pull/1800
Also fixes the test_ast_line_numbers_multiline_fstring
test to match https://github.com/python/cpython/pull/10021, since the issue solved in this CPython PR (and only available from CPython 3.8 onwards; see https://bugs.python.org/issue16806) is already handled correctly by PyPy.
I still don't fully get why in this test
def test_ast_mutiline_lineno_and_col_offset(self):
m = ast.parse("\n\nf'''{x}\nabc{y}\n{\nz}''' \n\n\n")
x_ast = m.body[0].value.values[0].value
y_ast = m.body[0].value.values[2].value
z_ast = m.body[0].value.values[4].value
assert x_ast.lineno == 3
assert x_ast.col_offset == 5
assert y_ast.lineno == 4
assert y_ast.col_offset == 5
assert z_ast.lineno == 6
assert z_ast.col_offset == 0
y_ast.col_offset
is 5 and not 4, but it's consistent with CPython 3.8, so there's probably something I'm missing.