(core) Use new asttokens.ASTText to support dollar signs inside f-strings

Summary:
Replaced uses of asttokens.ASTTokens with asttokens.ASTText when working with plain `ast` trees, and use `atok.get_text_range` instead of `node.first_token`.

Upgraded asttokens in Python 2 (it was already upgraded in Python 3).

Test Plan: Added a test with f-strings.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D4001
This commit is contained in:
Alex Hall
2023-08-23 12:45:14 +02:00
parent fe12562ad7
commit b9adcefcce
5 changed files with 29 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
### python 2 requirements, see requirements3.txt for python 3
astroid==1.6.6
asttokens==2.0.5
asttokens==2.2.1
backports.functools-lru-cache==1.6.4
chardet==4.0.0
enum34==1.1.10