On Tue, Sep 15, 2020, at 20:10, Greg Ewing wrote:
On 16/09/20 12:37 pm, Guido van Rossum wrote:
IMO if we were to standardize the AST for times immemorial this would have to be a separate PEP.
Perhaps, but a stable AST seems to be a prerequisite for this kind of feature. Preferably one that corresponds as closely as possible to the language syntax so that users can keep it in their heads.
Maybe the PEP should propose an AST of its own, which would initially be a third thing separate from either of the existing ones, with the possibility of adopting it as the ast module representation some time in the future.
The rust approach to this problem to pass only a token stream to the macro. Then, the macro writer brings their own parser.