Commit Graph

20 Commits

Author SHA1 Message Date
Guido van Rossum 5bde08dba3 Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in
the standard library.  I added a unit test for this.
Also removed the hack to force compilation of test_with.py.
2006-03-02 04:24:01 +00:00
Martin v. Löwis d9bfeac330 Reformat the exception message by going through a list. 2006-03-01 23:24:34 +00:00
Martin v. Löwis 15bfc3b082 Make failures in test cases print failing source file. 2006-03-01 21:11:49 +00:00
Guido van Rossum 7ad94f011e Update the compiler package to compile the with-statement.
Jeremy, please review!
2006-02-28 00:32:16 +00:00
Tim Peters 2841af4cec Revert revision 41940: the test causes -uall to
fail everywhere.
2006-01-07 23:20:46 +00:00
Georg Brandl 39cdfff691 Add compiler test regarding optional arguments. 2006-01-06 19:28:15 +00:00
Neal Norwitz f8950654e3 Fix compiler test when run with -u (long mode) 2005-10-24 00:01:37 +00:00
Neil Schemenauer f36947032f Fix compiler.ast.flatten function so that it works on lists. 2005-06-02 05:55:20 +00:00
Tim Peters e890682e52 Whitespace normalization. 2005-04-20 17:45:13 +00:00
Brett Cannon f4189916e3 Flush out support for ``class B(): pass`` syntax by adding support to the
'parser' module and 'compiler' package.

Closes patch #1176012.  Thanks logistix.
2005-04-09 02:30:16 +00:00
Michael W. Hudson e0b855fac9 test for fixedness of bug #1057835.
(thanks to Raymond for the prod).
2004-11-08 16:46:02 +00:00
Michael W. Hudson 29589a06f6 Open source files in universal newlines mode. 2004-10-11 15:34:31 +00:00
Tim Peters 0e9980f75a Whitespace normalization. 2004-09-12 03:49:31 +00:00
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.
2004-09-07 15:28:01 +00:00
Raymond Hettinger ed20ad8473 Change the strategy for coping with time intensive tests from
"all or none" to "all or some".

This provides much greater test coverage without eating much time.
It also makes it more likely that routine regression testing will
unearth bugs.
2004-09-04 20:09:13 +00:00
Tim Peters 0955f29703 Tell unittest that source files with "badsyntax" in their names should
raise SyntaxError.  test_compiler passes now on WinXP, at least in a
release-build non-O run.
2004-08-08 16:43:59 +00:00
Tim Peters 2a5f656d0c Renamed locals to better reflect their meanings. 2004-08-08 16:37:37 +00:00
Tim Peters b6ecc165f2 In verbose mode, display the name of each file before trying to compile
it.  Else when this fails, there's no way to tell which file it was
chewing on.
2004-08-08 16:32:54 +00:00
Tim Peters 9ca3f8551a Whitespace normalization. 2004-08-08 01:05:14 +00:00
Jeremy Hylton 4336eda886 Add a trivial test for the compiler package, guarded by compiler resource.
This test is insanely slow, so it requires a resource.  On my machine,
it also appears to dump core.  I think the problem is a stack
overflow, but haven't been able to confirm.
2004-08-07 19:25:33 +00:00