Commit Graph

890 Commits

Author SHA1 Message Date
Guido van Rossum
6e0a28f6cf Deleting tabpolice.py; it was superceded by tabnanny.py long ago. 2000-02-23 15:34:43 +00:00
Guido van Rossum
a02c898e69 Moved tabnanny.py to standard library status. 2000-02-23 15:33:52 +00:00
Guido van Rossum
dc6883365b Added tabnanny.py, by Tim Peters, formerly from Tools/scripts, to the
standard library.  Added some comments:

# XXX Note: this is now a standard library module.
# XXX The API needs to undergo changes however; the current code is too
# XXX script-like.  This will be addressed later.
2000-02-23 15:32:19 +00:00
Guido van Rossum
8c95c27c4c Added a new command: Check module (Alt-F5) It does a full syntax check
of the current module.  It also runs the tabnanny to catch any
inconsistent tabs.

Also did a little bit of refactoring: added an errorbox() method to
simplify the display of error dialogs.
2000-02-22 00:19:58 +00:00
Jeremy Hylton
772dd417f7 satisfy the tabnanny (thanks to MH for noticing the problem) 2000-02-21 22:46:00 +00:00
Jeremy Hylton
efd0694a2d changes to _lookupName
- removed now (happily) unused second arg
- need to verify results of [].index are correct; for building consts,
  need to have same value and same type, e.g. 2 not the same as 2L
2000-02-17 22:58:54 +00:00
Jeremy Hylton
3ec7e2c4be the previous quick hack to fix def foo((x,y)) failed on some cases
(big surprise).  new solution is a little less hackish.

Code gen adds a TupleArg instance in the argument slot. The tuple arg
includes a copy of the names that it is responsble for binding.  The
PyAssembler uses this information to calculate the correct argcount.

all fix this wacky case: del (a, ((b,), c)), d
which is the same as: del a, b, c, d
(Can't wait for Guido to tell me why.)

solution uses findOp which walks a tree to find out whether it
contains OP_ASSIGN or OP_DELETE or ...
2000-02-17 22:09:35 +00:00
Jeremy Hylton
7708d697ee add varargs and kwargs flags to Lambda nodes 2000-02-17 22:06:20 +00:00
Jeremy Hylton
873bdc18e4 satisfy the tabnanny
fix broken references to filename var in generateXXX methods
2000-02-17 17:56:29 +00:00
Guido van Rossum
99aabe30ce Add primitive customization of window size and font.
A few alternative selections can be made by changing "if 0" to "if 1".
2000-02-17 16:14:16 +00:00
Guido van Rossum
44cf8ef521 The 0.5 release happened on 2/15, not on 2/14. :-) 2000-02-16 01:22:35 +00:00
Jeremy Hylton
ad9a86fb1c support for arglists with implicit tuple unpacks
- added a number of support methods to generate code just before the
  body
- hack protocol for communicating number of args to PyAssembler

fix TryExcept generation for case where exception handler has no body
fix visitAssAttr
add comment about incomplete visitAssName

stop using the ExampleASTVisitor

change script invocation to accept a list of .py files (e.g. Lib/*.py)
2000-02-16 00:55:44 +00:00
Jeremy Hylton
3d9f5e4de2 more robust assignment of lineno for keyword args
get the lineno from the name of the keyword arg

example of case that didn't work--
def foo(x, y, a = None,
	b = None):
2000-02-16 00:51:37 +00:00
Jeremy Hylton
2ce27b223b fix argcount generation for arg lists containing tuple unpacks
this is sort of a hack
2000-02-16 00:50:29 +00:00
Jeremy Hylton
65d4ea05d2 add flatten helper function 2000-02-16 00:49:47 +00:00
Jeremy Hylton
4f6bcd80fc finish first impl of code generator
add support for nodes TryExcept, TryFinally, Sliceobj
fix visitSubscript to properly handle x[a,b,c]
2000-02-15 23:45:26 +00:00
Jeremy Hylton
1ebba96871 fix creation of Ellipsis node 2000-02-15 23:43:19 +00:00
Jeremy Hylton
410e840c85 add a little debugging support when new.code raises SystemError 2000-02-15 21:59:50 +00:00
Jeremy Hylton
d603dee4a3 add line numbers to nodes in the except clause (when possible) 2000-02-15 21:30:48 +00:00
Jeremy Hylton
ca1ad182f2 tidy up tryexcept and tryfinally nodes 2000-02-15 21:30:00 +00:00
Guido van Rossum
6e83cacb18 A bit restructured. 2000-02-15 19:11:26 +00:00
Guido van Rossum
dec0b68d68 Oops, somehow the initial checkin was botched. :-( 2000-02-15 18:30:58 +00:00
Guido van Rossum
83d4657a06 Added some clarifications. 2000-02-15 18:20:28 +00:00
Guido van Rossum
90ad8589b1 Temporarily add a copy here for easy distribution. 2000-02-15 18:20:01 +00:00
Guido van Rossum
17ae233edc More changes. 2000-02-15 18:11:21 +00:00