Eli Bendersky added the comment:

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.

----------
keywords: +patch
Added file: http://bugs.python.org/file34679/new-asdl-parser.issue19655.1.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19655>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to