Update Demo/parser directory; backport unparse fixes from py3k.

This commit is contained in:
Mark Dickinson 2010-06-30 14:19:56 +00:00
parent 4aa5f6f1f2
commit 2037913507
5 changed files with 297 additions and 170 deletions

View file

@ -11,19 +11,19 @@ def testChunk(t, fileName):
global _numFailed
print '----', fileName,
try:
ast = parser.suite(t)
tup = parser.ast2tuple(ast)
# this discards the first AST; a huge memory savings when running
st = parser.suite(t)
tup = parser.st2tuple(st)
# this discards the first ST; a huge memory savings when running
# against a large source file like Tkinter.py.
ast = None
new = parser.tuple2ast(tup)
st = None
new = parser.tuple2st(tup)
except parser.ParserError, err:
print
print 'parser module raised exception on input file', fileName + ':'
traceback.print_exc()
_numFailed = _numFailed + 1
else:
if tup != parser.ast2tuple(new):
if tup != parser.st2tuple(new):
print
print 'parser module failed on input file', fileName
_numFailed = _numFailed + 1