Message373185
Looking at the suggested successor tools (redbaron, libCST, parso, awpa) ... all of them appear to use some variant of pgen2. But at some point Python will be using a PEG approach (PEP 617), and therefor the pgen2 approach apparently won't work.
For a number of projects, it's important to have a parse tree that contains all the "whitespace" information (indent, dedent, comment, newline, etc.) As far as I can tell, the new PEG parser won't provide that, and it seems that none of the successor tools will be able to handle future versions of Python syntax.
So, three questions:
1. Am I right that all proposed replacements (redbaron, libCST, parso, awpa) use some variation of the LL(1) and therefore will have trouble in the future?
2. Are there any plans (either part of the core development or as a project) for one of these replacements that is PEG-based? (Or a new project?)
3. Is Lib/ast.py going to continue being supported? (I infer that it will, with the change from LL(1) to PEG being mostly transparent - https://mail.python.org/archives/list/python-dev@python.org/thread/HOZ2RI3FXUEMAT4XAX4UHFN4PKG5J5GR/#4D3B2NM2JMV2UKIT6EV5Q2A6XK2HXDEH )
If Lib/ast.py continues to be supported, I think I can see a way of providing functionality similar to lib2to3 (in terms of an AST-ish thing with "whitespace" from the source, sufficient for tools such as yapf, black, pykythe, pytype, mypy, etc.) as a kind of wrapper to ast.py.
I suppose I should discuss this idea on python-dev? Is there an ongoing discussion? (I couldn't find any but might have been using the wrong search terms) |
|
Date |
User |
Action |
Args |
2020-07-06 22:11:18 | Peter Ludemann | set | recipients:
+ Peter Ludemann, gvanrossum, gregory.p.smith, vstinner, carljm, eric.snow, hroncok, corona10, BTaskaya |
2020-07-06 22:11:18 | Peter Ludemann | set | messageid: <1594073478.6.0.0822266273665.issue40360@roundup.psfhosted.org> |
2020-07-06 22:11:18 | Peter Ludemann | link | issue40360 messages |
2020-07-06 22:11:18 | Peter Ludemann | create | |
|