This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients benjamin.peterson, brett.cannon, eli.bendersky, eric.snow, larry, ncoghlan, rhettinger, serhiy.storchaka, skrah, techtonik
Date 2014-03-31.13:12:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1396271559.22.0.0586707806338.issue19655@psf.upfronthosting.co.za>
In-reply-to
Content
Attaching patch that implements this. To make it easier, the patch only replaces the ASDL parser - not touching anything else and leaving the output intact.

With this patch applied, when the Makefile is rerun it regenerates the actual AST code in:

  Include/Python-ast.h
  Python/Python-ast.c

However, as the new parser generates exactly the same files, the code above is identical to the originals (hg diff shows nothing). In practice this means that no one building Python should notice this change, unless she's playing with the ASDL input file itself. The Makefile will not even regenerate these files unless the parser or the ASDL file were modified.

I have some additional ideas - to be delayed for subsequent patches:

1. The existing Spark-based parser didn't have tests, but my parser does. I'll do something similar to test_tools.py, as Benjamin suggested (to test the parser only in source builds).
2. The code of asdl_c.py could be modernized and be made even cleaner.
3. The same is true of the generated C code for the AST.
History
Date User Action Args
2014-03-31 13:12:42eli.benderskysetrecipients: + eli.bendersky, brett.cannon, rhettinger, ncoghlan, larry, techtonik, benjamin.peterson, skrah, eric.snow, serhiy.storchaka
2014-03-31 13:12:39eli.benderskysetmessageid: <1396271559.22.0.0586707806338.issue19655@psf.upfronthosting.co.za>
2014-03-31 13:12:39eli.benderskylinkissue19655 messages
2014-03-31 13:12:38eli.benderskycreate