Message215234
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. |
|
Date |
User |
Action |
Args |
2014-03-31 13:12:42 | eli.bendersky | set | recipients:
+ eli.bendersky, brett.cannon, rhettinger, ncoghlan, larry, techtonik, benjamin.peterson, skrah, eric.snow, serhiy.storchaka |
2014-03-31 13:12:39 | eli.bendersky | set | messageid: <1396271559.22.0.0586707806338.issue19655@psf.upfronthosting.co.za> |
2014-03-31 13:12:39 | eli.bendersky | link | issue19655 messages |
2014-03-31 13:12:38 | eli.bendersky | create | |
|