New submission from Taihyun Hwang: Attached patch enables ASDL parser to construct fields in the right order.
It resolves the issue below in Parser/asdl.py # XXX can't I just construct things in the right order? We can safely use left-recursive grammar since Parser/spark.py implements Earley parser. The patch doesn't affect Python-ast.[ch] as expected. $ make Include/Python-ast.h Python/Python-ast.c $ diff -s ~/test/Python-ast.h Include/Python-ast.h Files /home/xenosoz/test/Python-ast.h and Include/Python-ast.h are identical $ diff -s ~/test/Python-ast.c Python/Python-ast.c Files /home/xenosoz/test/Python-ast.c and Python/Python-ast.c are identical Time consumption before/after the patch: -- before patch -- time make Include/Python-ast.h real 0m0.578s \ user 0m0.500s \ sys 0m0.060s time make Python/Python-ast.c real 0m0.687s \ user 0m0.620s \ sys 0m0.050s -- after patch -- $ time make Include/Python-ast.h real 0m0.588s \ user 0m0.510s \ sys 0m0.060s $ time make Python/Python-ast.c real 0m0.677s \ user 0m0.630s \ sys 0m0.030s It touches: Misc/ACKS Parser/asdl.py ---------- components: Interpreter Core files: asdl1.patch keywords: patch messages: 167056 nosy: taihyun.hwang priority: normal severity: normal status: open title: Minor trimming for ASDL parser type: enhancement versions: Python 3.3 Added file: http://bugs.python.org/file26631/asdl1.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15517> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com