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
Guido van Rossum
1d841fec12 Notice status back and stack viewer. 2000-02-15 18:08:19 +00:00
Guido van Rossum
ec73dc6700 Support for Moshe's status bar. 2000-02-15 18:05:15 +00:00
Guido van Rossum
17752f7c4b Status bar code -- by Moshe Zadka. 2000-02-15 18:04:52 +00:00
Guido van Rossum
2bb8e72046 Adding the old stack viewer implementation back, for the debugger. 2000-02-15 18:04:09 +00:00
Guido van Rossum
b658469873 New stack viewer, uses a tree widget.
(XXX: the debugger doesn't yet use this.)
2000-02-15 18:03:40 +00:00
Guido van Rossum
553fa4432a Correct a typo and remove an unqualified except that was hiding the error. 2000-02-15 18:03:01 +00:00
Guido van Rossum
f801f3b05c Add an XXX comment about the ClassBrowser AIP. 2000-02-15 18:02:11 +00:00
Guido van Rossum
0b5b2c89d7 Updated change log. 2000-02-15 17:19:25 +00:00
Guido van Rossum
46ffbecf94 News update. Probably incomplete; what else is new? 2000-02-15 17:17:58 +00:00
Guido van Rossum
6d3be50653 Updated for pending IDLE 0.5 release (still very rough -- just getting
it out in a more convenient format than CVS).
2000-02-15 17:16:40 +00:00
Guido van Rossum
b4b8381f4f Tiny addition. 2000-02-15 17:15:36 +00:00
Jeremy Hylton
9e1cd688b5 edit a doc string
(real intent is to test out rsync install)
2000-02-14 23:57:56 +00:00
Jeremy Hylton
a46fb3841b get rid of spurious print 2000-02-14 21:54:57 +00:00
Guido van Rossum
967e509a81 Patch by Gerrit Holl:
* In crlf.py and lfcr.py: regsub -> re
2000-02-14 21:42:14 +00:00
Guido van Rossum
d962878309 Patch by Gerrit Holl:
* In logmerge.py: added '-r' flag to show the oldest checkin
      first instead of the newest, and getopt.getopt was used
      wrong.
2000-02-14 21:41:50 +00:00
Jeremy Hylton
126960b744 looks like everything is working except for try/except (pystone
compiles correctly)
2000-02-14 21:33:10 +00:00
Jeremy Hylton
17988d2a17 LeftShift & RightShift: fix reprs, change attr names to left and right
(so they are common with other binary ops)
2000-02-14 21:32:42 +00:00
Jeremy Hylton
bf6267e6f8 rename several of the generic attribute names for nodes. new node attrs are:
Exec: expr, locals, globals
Dict: items
Assert: test, fail
2000-02-14 18:34:11 +00:00
Jeremy Hylton
42907790b6 (), [], and {} should not be represented as constant expressions, they
should be calls to BUILD_ ops for these types with no arguments
2000-02-14 18:32:46 +00:00
Jeremy Hylton
a50581228e split compile.py into two files
add StackDepthFinder (and remove push/pop from CodeGen)
add several nodes, including Ellipsis, Bit&|^, Exec
2000-02-14 14:14:29 +00:00
Jeremy Hylton
3050d51571 change MODULE_NAMESPACE/FUNCTION_NAMESPACE stuff to have a single flag
named OPTIMIZED, which matches compile.c and makes more sense for
classes

revamp call signature for PythonVMCode.__init__; doesn't really matter
'cuz this code is going to be refactored out of existence

add generateClassCode and modify Func & Lambda generation

add support for nodes Classdef, Keyword,

fix CallFunc to generate right op arg when calling w/ keywords

add ugly hack to properly compute offsets when the same stack ref is
used multiple times
2000-02-12 00:12:38 +00:00
Jeremy Hylton
76d01b820c add support for Lambda nodes
change resolution of local name ops (LOAD_FAST).  i think it makes
sense now.  if it is an argument or a local var name that it used, it
must be in varnames.  if it is a local var name that is used, it must
also be in names
2000-02-11 20:27:07 +00:00
Jeremy Hylton
4eb504c2af add loop handling via
Loop object to handle StackRegs
loops stack attr on CodeGenreeator to hold the current loop object

add support for nodes While, Break, Continue
2000-02-10 20:55:50 +00:00
Jeremy Hylton
95b8614353 add an __len__ to Set and Stack 2000-02-10 20:54:27 +00:00
Jeremy Hylton
3e0910c10c add namespace attr to CodeGenerator, can be either MODULE_NAMESPACE or
FUNCTION_NAMESPACE.  initialize in __init__ and reset in
generateFunctionCode.

replace direct issue of STORE_FAST, STORE_GLOBAL, etc. with call to
storeName; same for loadName and deleteName

the new {store,load,delete}Name methods use the namespace attr and the
local variable stack to determine the correct bytecode to issue
2000-02-10 17:20:39 +00:00